Forum Discussion

Edgar Soares's avatar
Edgar Soares
Copper Contributor
Feb 19, 2019
Solved

Copy cell value from different table row

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 enlarge

 

Additionally, I cannot use either macros or VBA.

Thanks in advance,

Edgar

  • 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

2 Replies

  • Twifoo's avatar
    Twifoo
    Silver Contributor
    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
    • Edgar Soares's avatar
      Edgar Soares
      Copper Contributor

      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

Resources