I need some help with an excel formula. In E2, I need to do a formula like this:
=if(A2=1,find-in-Column-C-starting-from-C2,where-next-"Fruit"-is, and-return-the-adjacent-cell-in-column-B, else return blank)
E2 should return B3
E4 should return B5
E6 should return B11
E12 should return B12
E13 should return B17
and so on.
You can try the following for an array solution that spills the entire result. I am assuming there is no Excel version constraints as per the tags listed in the question.
=LET(A,A1:A16, B,B1:B16, C,C1:C16, seq,SEQUENCE(ROWS(A)), MAP(A,seq,
LAMBDA(x,s,IF(x=1,@FILTER(B,(seq>=s)*(C="Fruit"),""),""))))
We use @
-operator to get the first element of the FILTER
result. The third FILTER
input argument is used to prevent any error in case the output is empty.