Forum Discussion
Jamie Swan
Apr 06, 2018Copper Contributor
Excel Formula Help
Hoping someone can help. I'm trying to write a formula for the following example:
Cell A1 will have A,B,or C entered.
Cell D1 will have a number (let's say 5)
Cell E1 formula: if A1 is A then ...
Haytham Amairah
Apr 06, 2018Silver Contributor
Hi Jamie,
This is the correct syntax of the formula which is called (Nested IF):
=IF(A1="A",D1*3,IF(A1="B",D1*4,IF(A1="C",D1*5,0)))
NOTE: If the cell A1 doesn't contain A, B, or C, the formula will return 0.
Hope that helps
Haytham
- Jamie SwanApr 06, 2018Copper Contributor
Thank You! I was making the formula more complex than it needed to be. Thanks Again!
- JamilApr 06, 2018Bronze ContributorWhile Haytham solution works for you.
here are another two ways you can achieve the same result. simplified =D1*IF(A1="A",3,IF(A1="B",4,IF(A1="C",5,0)))
and with VLOOKUP
=D1*IFERROR(VLOOKUP(A1,{"A",3;"B",4;"C",5},2,0),0)