Skip to main content
Commonmark migration
Source Link

There is no single formula that could return results for both the Closest at or below as well as the Closest at or above. We can have though one simple query for each.

###Closest value for equal or lower

Closest value for equal or lower

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 <= "&H1&" order by Col1 desc limit 1",0)

###Closest value for equal or greater

Closest value for equal or greater

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 >= "&H1&" order by Col1 limit 1",0)

closest value from two-dimensional data in Google Sheets without VLOOKUP

Functions used:

There is no single formula that could return results for both the Closest at or below as well as the Closest at or above. We can have though one simple query for each.

###Closest value for equal or lower

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 <= "&H1&" order by Col1 desc limit 1",0)

###Closest value for equal or greater

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 >= "&H1&" order by Col1 limit 1",0)

closest value from two-dimensional data in Google Sheets without VLOOKUP

Functions used:

There is no single formula that could return results for both the Closest at or below as well as the Closest at or above. We can have though one simple query for each.

Closest value for equal or lower

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 <= "&H1&" order by Col1 desc limit 1",0)

Closest value for equal or greater

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 >= "&H1&" order by Col1 limit 1",0)

closest value from two-dimensional data in Google Sheets without VLOOKUP

Functions used:

Source Link
marikamitsos
  • 13.1k
  • 4
  • 34
  • 59

There is no single formula that could return results for both the Closest at or below as well as the Closest at or above. We can have though one simple query for each.

###Closest value for equal or lower

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 <= "&H1&" order by Col1 desc limit 1",0)

###Closest value for equal or greater

=QUERY({flatten('Z table'!C2:L41)},"select Col1 where Col1 >= "&H1&" order by Col1 limit 1",0)

closest value from two-dimensional data in Google Sheets without VLOOKUP

Functions used: