Forum Discussion
Excel IF-formula
Hi all,
I'm looking for the easiest formula for the IF-function.
This is what I'm exactly looking for:
If C2 = V-838-NN then N2 has to be € 70,83.
So each licence plate/vehicle has a different daily cost. If we replace V-838-NN with an different vehicle the costs in N2 has to change also.
Is there anyone who can help me with the right formula ?
Thanks in advance,
Fatih
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).
6 Replies
- Subodh_Tiwari_sktneerSilver Contributor
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.
- Fatih_PolatCopper Contributor
Thank you so much. It was the Vertical Lookup formula that was missing.
Now it's working.
Thanks !
- Subodh_Tiwari_sktneerSilver Contributor
No problem! 🙂
- Riny_van_EekelenPlatinum Contributor
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).
- Fatih_PolatCopper ContributorThanks for your help ! This is what I'm looking for.
Dankjewel !- Riny_van_EekelenPlatinum Contributor
Fatih_Polat Graag gedaan!