I have a spreadsheet w/ a PRICE column, a CODE column, and a DIFFERENCE column. I'd like to have a formula in the DIFFERENCE column that will multiply the PRICE value, and return a value in the DIFFERENCE column, based off of the value entered in the CODE column. For example...If I were to enter a P in the CODE column, I want the DIFFERENCE formula to return a value that is (PRICE*.18). If I were to enter a G, I want the DIFFERENCE formula to return a value that is (PRICE*.33). If I were to enter an O, I want the DIFFERENCE formula to return a value that is (PRICE*0). Obviously the part for the PRICE*0 could skip the multiplication action and just enter a zero if that's a more efficient way.

I was thinking it could be something like this...

=IF(B2=O,0,IF(B2=G,A2*.33,IF(B2=P,A2*0.18)))

or this...

=IF(B2=O,A2*0,IF(B2=G,A2*.33,IF(B2=P,A2*0.18)))

but...neither seem to work. I had a dummy spreadsheet to attach but not sure how to do that either...

Thanks in advance