# Formula to find a value by going right, down, and then left.

#### lpomykal

##### New Member
I am looking for a formula that will find the value in cell B1 in the row B5:I5. Then go down from that date to the first non-blank cell. Then go left and return the corresponding value/name in column A6:A12 into cell F1.

Thanks in advance. I have been racking my head trying to figure this out. I was using =INDEX(\$A\$6:\$A\$12,SMALL(IF(\$H\$6:\$H\$12<>"",ROW(\$H\$6:\$H\$12)-ROW(\$H\$6)+1),ROW(A1))) to find the nth non-blank cell and return the corresponding name, but that requires the column to be called out in the IF formula. For this I tried to use =MATCH(B1,B5:I5,0). This just gives me the column number within the range. I can't figure out how to combine the two formulas (if that is even possible).

#### lpomykal

##### New Member
You're welcome.

I would advise to always use a ROWS() construct, referencing the row(s) that the formula is in. With your method if any row(s) are subsequently inserted at the top of the sheet the sequence will become 2, 3, 4, ... or 7, 8, 9, .. rather than always being 1, 2, 3, ... & the formula involved will return incorrect results (which may not always be obvious).
Makes sense. I have had that problem before but didn’t know ROW() would not recognize new rows.

### Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Replies
4
Views
344
Replies
5
Views
68
Replies
10
Views
181
Replies
6
Views
108
Replies
7
Views
118