Forum Discussion

CADDmanDH's avatar
CADDmanDH
Copper Contributor
Apr 28, 2024

Help with XLookup to change Search Ranges per a Selected Condition

Hello Xcel Pros,      I've used XLookup for a number of things, but I can find, figure out, or wrap my head around what I think could be easy enough to do, but I am just missing it, or I'm trying to...
  • djclements's avatar
    Apr 28, 2024

    CADDmanDH Another option is to use the secondary syntax of the INDEX function to reference multiple areas (reference, row_num, [column_num], [area_num])...

     

    =INDEX((F6:H12,I6:K12,L6:N12), D16, 0, C16) + INDEX(C6:E12, D16, 0)

     

    ...where the Unit Selector (numeric value from 1 to 7) is the row_num and the Condition Selector (numeric value from 1 to 3) is the area_num.

     

    If you prefer the Unit/Condition Selectors to reference the row/column labels, you will need to use the MATCH or XMATCH function to return the corresponding row_num and area_num.

     

    See the attached workbook for additional examples...