Results 1 to 6 of 6

Thread: IF Statement - brain fog!
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Mar 2006
    Location
    West Sussex UK
    Posts
    149
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default IF Statement - brain fog!

    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

  2. #2
    Board Regular tyija1995's Avatar
    Join Date
    Feb 2019
    Posts
    648
    Post Thanks / Like
    Mentioned
    14 Post(s)
    Tagged
    4 Thread(s)

    Default Re: IF Statement - brain fog!

    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 by tyija1995; Aug 16th, 2019 at 07:16 AM.
    √-1 2³ ∑ π
    …And it was delicious!

  3. #3
    Board Regular steve the fish's Avatar
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    7,668
    Post Thanks / Like
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)

    Default Re: IF Statement - brain fog!

    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.
    Looking for opportunities

  4. #4
    New Member
    Join Date
    Aug 2019
    Posts
    11
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Statement - brain fog!

    Quote Originally Posted by chally3 View Post
    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?"))

  5. #5
    Board Regular
    Join Date
    Mar 2006
    Location
    West Sussex UK
    Posts
    149
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Statement - brain fog!

    Thanks all

  6. #6
    Board Regular
    Join Date
    Mar 2006
    Location
    West Sussex UK
    Posts
    149
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Statement - brain fog!

    That the one, thank you, definitely suffering brain fog today ! I should have known that for sure, basic maths!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •