Forum Discussion

warwick_Hope's avatar
warwick_Hope
Copper Contributor
May 13, 2019
Solved

Version of Lookup formula?

Have a table dates across the top and items down the side.

 

The body of the table gets populated with "1s" which auto formats to a cell colour.

 

Id like to create a column that looks up when a row has a "1" in and then returns the date in the column header.

 

Just struggling to find what sort of formula to use for it any guidance would be appriciated

11 Replies

  • warwick_Hope 

    When dynamic arrays are released, multiple matches will be returned by

    = FILTER( Date, Criterion )

    To do something similar now would need

    = SMALL( IF( Criterion, Date ), {1,2,3} )

    The dates could also be listed in a wrapped cell using

    = TEXTJOIN( CHAR(10), TRUE, IF( Criterion, TEXT(Date,"dd mmm"), "" ) )

    • warwick_Hope's avatar
      warwick_Hope
      Copper Contributor

      Detlef_Lewin 

      If there is more than one cell filled in a row, the formula picks up the cell furthest to the right.

      This is fine in the main but just wanted to know if there was any way of changing it to pick the first cell it comes to? (furthest to the left?)

  • Twifoo's avatar
    Twifoo
    Silver Contributor
    I suppose you want to return the date IF the cell contains 1; otherwise, you want to return empty text. I hope you now know what formula to use.
    • warwick_Hope's avatar
      warwick_Hope
      Copper Contributor

      I had tried using "IF" but the "1" could be in any cell across the table, and i didnt want to have to create a long formula with 20 "IF" Logical tests!
      Is there a shorter way of achieving the same thing?

Resources