Forum Discussion
Excel IF-formula
- Feb 07, 2020
You want a more dynamic solution than just with IF. The attached workbook has a simple example how you combine a table containing plates and cost with cell that displays the cost (using VLOOKUP) for a selected plate (using Data Validation).
If you have only few licence plates say 2 or 3 ,you may go with the IF formulas as it would be easy to maintain the formula. The other downside of the IF formula would be, you will need to place the hard coded costs in the formula so it would be troublesome for you if you ever need to tweak the formula.
e.g. you may have the following formula in N2
=IF(C2="V-838-NN",70.83,IF("V-838-NO",75.5,""))
Refer to the 'IF Formula" Sheet in the attached.
I would suggest you to make a Lookup Table as shown on the "Lookup_Table" in the attached and then use the following formula in N2
=IF(C2="","",IFERROR(VLOOKUP(C2,Lookup_Table!$A:$B,2,0),"Unknown Licence Plate"))
Refer to the "Formula Using Lookup Table" Sheet in the attached.
The lookup table would be easy to maintain if required and you can add more licence plates in column A and their corresponding costs in column B as many as you want and formula will pick the correct cost as per the licence plate entered in column C.
Thank you so much. It was the Vertical Lookup formula that was missing.
Now it's working.
Thanks !
- Subodh_Tiwari_sktneerFeb 07, 2020Silver Contributor
No problem! 🙂