Search code examples
google-sheetsfiltergoogle-sheets-formulagoogle-query-language

How do I get the first element in a row returning True on a given function in Google Sheets


Say I have a table with two columns: name and age, and that the table's rows are ordered by age.

I need a function to find the name of the youngest person who is at least 50 years old.

Example

For this list:

Name Age
Nordom 3
Annah 19
Ignus 56
Morte 72

We'd get "Ignus".


Solution

  • As you said age column is sorted so can try below formula.

    =INDEX(FILTER(A2:A5,B2:B5>=50),1)
    

    enter image description here