IF statement problem

Fin2022

New Member
Joined
Dec 14, 2017
Messages
1
Hello,

I'm having trouble with calculating a formula. Refer to the numbers below for the questions.

1. I want to calculate if the PIR price equals the Invoice price to change the PO price to the PIR price.
2. Then if the PIR price and Invoice price don't match up, color code the Invoice with red. Unless the PO price is equal to the Invoice price. Then leave the invoice price alone.

[TABLE="width: 261"]
<tbody>[TR]
[TD]PO Price[/TD]
[TD]PIR Price[/TD]
[TD]Invoice Price[/TD]
[/TR]
[TR]
[TD="align: right"]1.6283[/TD]
[TD="align: right"]1.6283[/TD]
[TD="align: right"]1.7283[/TD]
[/TR]
</tbody><colgroup><col span="2"><col></colgroup>[/TABLE]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Using a formula in cells where data already exists (in this case the cell for the PO Price) isnt a good idea because the formula will overwrite the values already in that cell. I'd suggest a macro to evaluate the cell values then make changes accordingly. but if you want to continue to try to use a formula i'd suggest a new cell for Adjust PO Price. the Adjusted PO Price wout be the PO price after the logical statements are evaluated.

Col A | Col B |Col C |Col D
PO Price | PIR Price | Inv Price | Adjusted PO Price
1.6283 | 1.6283 | 1.7283 | =IF(B2=C2, B2, A2)

then use conditional formatting on cell D2 with the formula: =$B2<>$C2 and then enter the desired formatting for when that condition is met.

Good luck.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top