Forum Discussion
Apply one markup if A matches B, else apply second markup
- Apr 17, 2018
Hi Karen,
Welcome to Microsoft Excel Community!
I think that the definition of markup is the amount you want to add it to the unit price.
Based on this definition, please put this formula in cell D2 and drag it down:
=IF(LEFT(A2,1)="b",(C2*VLOOKUP(B2,$F$2:$H$4,2,0))+C2,(C2*VLOOKUP(B2,$F$2:$H$4,3,0))+C2)
I hope this helps you
Haytham
Hi Karen,
Please show me how the data looks like.
It's different from the original data in this conversation.
Morning Haytham,
I have created a sample test sheet, as the data is very sensitive . . . but as you can see, the formulas are still not correct for the products starting with B!
I am baffled . . . . but i am sure it is probably something really stupid that i am missing!
Kind Regards,
Karen
- Karen RobertsMay 14, 2018Copper Contributor
With attachment . . .
- Haytham AmairahMay 14, 2018Silver Contributor
Hi Karen,
I think you have changed something in the calculation priorities of the formula.
Let's compare the formula in cell X4 with the correct one.
Before (Original formula)
=IF(LEFT($D4,1)="B",($O4*(VLOOKUP($J4,Sheet2!$A$2:$C$11,2,0)))+$O4,
($O4*(VLOOKUP($J4,Sheet2!$A$2:$C$11,3,0))))+$O4After
=IF(LEFT($D4,1)="B",($O4*(VLOOKUP($J4,Sheet2!$A$2:$C$11,2,0)))+$O4,
($O4*(VLOOKUP($J4,Sheet2!$A$2:$C$11,3,0)))+$O4)Please take a look at the end of each formula, and note the difference.
Regards
- Karen RobertsMay 14, 2018Copper Contributor
You're joking!? It was as simple as the ")" being in the wrong place? I would have never thought that it would cause such an issue . . . . just shows my inexperience!
Thank you sooooo much. You are a legend!
Karen x