Reputation: 563
Col A | Col B | Col C | Col D | Col E |
---|---|---|---|---|
5000 | 1000 | 100 | ||
5000 | 1000 | 100 | 150 |
Currently my formula for Col E is
=SUM(Col B * 12 - Col C / Col A)
How do I change my formula so that if Col D have value, it will take Col D value else, it will take Col C value?
Can someone out there please help me out with this? Thanks!
Upvotes: 0
Views: 1553
Reputation: 1134
The formula on the comments works. However, I think it is clearer for beginners to put the IF outside and the full formulas inside. I mean:
=IF(D2="", (B2*12-C2)/A2, (B2*12-D2)/A2)
In words, if D2 is empty use the 1st formula. Else, use the 2nd formula.
I would use the function ISBLANK to get when column D is empty. In that case:
=IF(ISBLANK(D2), (B2*12-C2)/A2, (B2*12-D2)/A2)
If that is true that D2 is blank, use the 1st formula. Else, use the 2nd one.
Upvotes: 1