Forum Discussion
Excel Help with IF and Greater than less than
hookvikes
The IF statement is missing AND functions:
=IF(K<180,Yield*C17,
IF(AND(K>=180,K<240),C17*Yield,
IF(AND(K>=240,K<300),C17*Yield*0.75,
IF(AND(K>=300,K<350),C17*Yield*0.5,
IF(K>=350,0)))))
But don't do that. This is a "Nested IF" statement which is notoriously hard to maintain and easy to get wrong. There is a better way. Use a table which you can easily update instead then replace that long nested IF statement with this:
=Yield*C17*VLOOKUP(K,tblFactors,2,TRUE)
Below is tblFactors.
I recommend using a table because:
1) If the factor or K threshold changes, just change it in the table.
2) If we want to add a 500 K threshold, we do not have to change the formula
To create a table, enter it as you see here then select any value and press CTRL-T. Check Yes my table has headers then type tblFactors in the name box located in the ribbon's left lower corner.
Hope that helps