IF Statement - brain fog!

chally3

Board Regular
Joined
Mar 22, 2006
Messages
157
Good morning everyone, can anyone help please as Im having a Real brain fog day!

My if statement is =IF(G4=E4,F4,IF(G4>E4,SUM(C4-D4*G4))) which is not returning the value expected and I cannot work out where I have gone wrong.

Column info C=price 1, D=price 2,E = sum of qty received 1, F=(price 1 - price 2 * column E) , G=sum of qty received 2
What I am trying to calculate for instance is

IF Column G is equal to Column E return the value in F, IF G is more than E, price 1 - price 2 * sum of qty received 2

Thank you
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,

It might be because you are doing C4 - (D4 * G4), perhaps you want (C4 - D4)*G4 ?

If that is the case then just put an opening bracket before C4 and a closing bracket after D4, like: SUM((C4-D4)*G4)
 
Last edited:
Upvote 0
There is a principle of mathematics that multiplication and division are done before addition and subtraction so maybe put some brackets around this part:

C4-D4*G4

to become

(C4-D4)*G4

and you dont need the sum.
 
Upvote 0
Good morning everyone, can anyone help please as Im having a Real brain fog day!

My if statement is =IF(G4=E4,F4,IF(G4>E4,SUM(C4-D4*G4))) which is not returning the value expected and I cannot work out where I have gone wrong.

Column info C=price 1, D=price 2,E = sum of qty received 1, F=(price 1 - price 2 * column E) , G=sum of qty received 2
What I am trying to calculate for instance is

IF Column G is equal to Column E return the value in F, IF G is more than E, price 1 - price 2 * sum of qty received 2

Thank you

=IF(G4=E4,F4,IF(G4>E4,SUM(C4-D4*G4),"what to do if false?"))
 
Upvote 0
That the one, thank you, definitely suffering brain fog today ! I should have known that for sure, basic maths!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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