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

lpomykal

New Member
Joined
Dec 8, 2016
Messages
7
Office Version
  1. 365
Platform
  1. Windows
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).
Capture.JPG
 

lpomykal

New Member
Joined
Dec 8, 2016
Messages
7
Office Version
  1. 365
Platform
  1. Windows
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.
 

Some videos you may like

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.

Watch MrExcel Video

Forum statistics

Threads
1,114,021
Messages
5,545,542
Members
410,690
Latest member
navneetr
Top