SOLVED

Copy cell value from different table row

Copper Contributor

Hi, everyone.

Trying to write a formula that will check a table's first column cell's value and, if it meets a criteria to do one thing and, if it does not meet a criteria, then try that first column's previous cell up (previous row above current one), if it still does not meet the criteria, then keep trying the previous cells up until it finds a cell on that first column that meets the criteria.

Hopefully the image below will make the request a bit more clear:

Click to enlargeClick to enlarge

 

Additionally, I cannot use either macros or VBA.

Thanks in advance,

Edgar

2 Replies
best response confirmed by Edgar Soares (Copper Contributor)
Solution
Hello Edgar,
Assuming your Column labels are in A1:I1 and your data starts at A2, your formula in I2, copied down to rows thereunder, is:
=IF(OR(A2={"FLUORESCENT","LED"}),
LOOKUP(2,1/((A$2:A2<>"FLUORESCENT")*(A$2:A2<>"LED")),A$2:A2),
CHAR(150))
If you prefer an em dash over en dash, you can modify CHAR(150) to CHAR(151).
Cheers!
Twifoo

Hi, @Twifoo 

I just did a quick test and this is exactly what I was looking for! LOOKUP is it!

Thank you so much,

Edgar

1 best response

Accepted Solutions
best response confirmed by Edgar Soares (Copper Contributor)
Solution
Hello Edgar,
Assuming your Column labels are in A1:I1 and your data starts at A2, your formula in I2, copied down to rows thereunder, is:
=IF(OR(A2={"FLUORESCENT","LED"}),
LOOKUP(2,1/((A$2:A2<>"FLUORESCENT")*(A$2:A2<>"LED")),A$2:A2),
CHAR(150))
If you prefer an em dash over en dash, you can modify CHAR(150) to CHAR(151).
Cheers!
Twifoo

View solution in original post