Forum Discussion

Jpalaci1's avatar
Jpalaci1
Brass Contributor
Jul 27, 2021
Solved

Lookup/bring in values from data array into table

I want to take the data from an array and lookup based on the ID #, current month, and correct year but not sure how to get there.   I put the answer of how it should be to the right of the table b...
  • PeterBartholomew1's avatar
    Jul 27, 2021

    Jpalaci1 

    There are many variations that can be used depending both upon personal preferences and Excel version.  Since I develop for Excel 365, I would go for INDEX and XMATCH, though XLOOKUPS would also be possible.  A common trick for matching two rows/columns is to concatenate them.  In the present case, the year and month can be combined more naturally as an Excel date serial value.

    = LET(
      date,    DATE([@Year], [@Month], 1),
      dateHdr, DATE(year, month, 1),
      rowNum,  XMATCH([@ID],ID),
      colNum,  XMATCH(date, dateHdr),
      INDEX(Value, rowNum, colNum) )

Resources