Following the example code and comment given by OP, event A, B, C, D is referred.
A is P14273
B is AX14273
C is H14273:O14273
D is Q14273:AW14273
E is AY14273:CH14273
(I add this for clearer example)
[ Condition ]
(in sequence of priority..)
IF any value in C, D, E is later or the same day as B. Then, it will not be evaluated
IF C, D, E date is before B. Then, It will be evaluated
IF abs(A-B)< abs(B-C) , for all C. Then, Cond1 is TRUE
IF abs(A-B)< abs(B-D) , for all D. Then, Cond2 is TRUE
IF abs(A-B)< abs(B-E) , for all E. Then, Cond3 is TRUE
IF and(Cond1,Cond2,Cond3) is TRUE. Then, Output is "Yes"
Else, Output is "No"
IF C, D, E date is before B Then, Output is "" (nothing) <-- (I add this for clearer example)
[ Execution ]
Example for considering only A,B,C :
=IF(MIN(H14273:O14273)\>=AX14273,"",
IF(ABS(P14273 - AX14273)
\< MAX(
ABS( AX14273 - IF(H14273:O14273\>=AX14273,AX14273,H14273:O14273) )
),
"Yes" , "No")
)
considering all A-E :
=IF(MIN(H14273:O14273)\>=AX14273,"",
IF(ABS(P14273 - AX14273)
\< MAX(
ABS( AX14273 - IF(H14273:O14273\>=AX14273,AX14273,H14273:O14273),
ABS( AX14273 - IF(Q14273:AW14273\>=AX14273,AX14273,Q14273:AW14273),
ABS( AX14273 - IF(AY14273:CH14273\>=AX14273,AX14273,AY14273:CH14273) )
),
"Yes" , "No")
)
[ Notes ]
=IF(H14273:O14273>=AX14273,AX14273,H14273:O14273)
is an array formula, so if it is typed into a cell.. it will spill to the right.
ABS(AX14273-IF(H14273:O14273>=AX14273,AX14273,H14273:O14273)
will '0' the dates later than AX14273, then find the maximum date difference in the range.
Please share if it works/not/understandable. \(^_^)/