excelformulaxlookup

Excel: Lookup '1' and return multiple values


This seems rather simple be cannot currently find a solve for this.

I am currently in a spreadsheet, which has a column that is returning a binary value on the basis of random sampling.

I need to lookup the value '1', in this column and return all matching values from another 'item number' column in the same sheet.

I have tried XLOOKUP and Index Match, but they seem to just be returning the first value in the item number column, where I need each value returned in its own row.

Thanks in advance!

XLOOKUP, INDEX MATCH


Solution

  • Perhaps you want to use FILTER, like so:

    =FILTER(B2:B10,A2:A10=1)
    

    This filters your list to only include the rows were Column A = 1, and gives you all the matching values from Column B.

    enter image description here