IF Statement - brain fog!

chally3

Board Regular
Joined
Mar 22, 2006
Messages
155
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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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