Adding a filter to query for row# in google sheets

77 views Asked by At
ROWS(B1:XLOOKUP(P22,B:B,B:B)

The above snippet returns the first row# where a value in column B matches P22. How would I add a filter to only return row#'s where J:J="foo"?

filter(ROWS(B1:XLOOKUP(P22,B:B,B:B),J:J="foo")

This doesn't work.

Update:

=XLOOKUP(P22&J22,ARRAYFORMULA(B:B&J:J),B:B)

J22="foo"

This returns the data from the first row in column B where a value matches P22, and the value in column J matches "foo". So we have succeeded in returning the correct row, now I just need it to return the actual row# instead of "foo".

=XLOOKUP(P22&J22,ARRAYFORMULA(B:B&J:J),return row # here)
0

There are 0 answers