Search code examples
arraysif-statementgoogle-sheetsvlookupnested-if

google sheet : How to vlookup by matching value in between max and min?


I have 2 sheets like this :

enter image description here

enter image description here

In that 2nd sheet, i want to lookup the id (S/M/L/XL) by checking if value is in between the Min value and Max value. So the goal is to have something like that 2nd sheet where in 'level' column, i need to put a formula so it will check the value is between what range so then it will retrieve the correct 'id' from 1st sheet.

the rule is if the value is >= minvalue and < max value

How can i do this ?

Thanks


Solution

  • use:

    =INDEX(IF(A9:A="",,VLOOKUP(A9:A, {C2:C5, A2:A5}, 2, 1)))
    

    enter image description here