The Memory Bank

...for memory blanks

Site Tools


google_sheets

QUERY to Find Nth Occurrence in Google Sheets

To find the second occurrence of “Mango” in column A and get the corresponding value from column B, you can use the following QUERY formula:

=QUERY(A1:B, "SELECT B WHERE A='Mango' LIMIT 1 OFFSET 1", 0)

If your data has a header row, you should use it as follows:

=QUERY(A1:B, "SELECT B WHERE A='Mango' LIMIT 1 OFFSET 1 LABEL B'' ", 1)
google_sheets.txt · Last modified: by 127.0.0.1