Forum Discussion
Neruu
Mar 30, 2024Copper Contributor
Nested IF Function not working
Hi I have a column of temperature and the percentage. I want the percentage column (D) is based on the temperature column (C) where: IF 30=7 31=7 32=9 33=9 34=11 35=1...
Patrick2788
Mar 30, 2024Silver Contributor
I prefer to avoid nesting more than 3 IFs and I don't use IFS.
Two approaches:
Option 1: Create a dedicated lookup table and use XLOOKUP:
=XLOOKUP(C2:C25,temp,percentage,0,-1)Option 2: Use SWITCH to simplify the logic:
=SWITCH(C2:C25,30,7,31,7,32,9,33,9,34,11,35,11,0)