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)
Functions used: