+ Reply to Thread
Results 1 to 5 of 5

2 check if statement

Hybrid View

  1. #1
    Registered User
    Join Date
    10-08-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    3

    2 check if statement

    Hello all,

    I'm trying to do a 2 check statement, and i nearly have it, but the last bit is beating me and i'm confused as to how tofix it.

    my formula is:

    =IF(Input!D5-Input!E5=0, ROUND((Input!E5/(Input!O2/100+1)),2),IF(Input!G5 =1,ROUND((Input!E5/(Input!O2/100+1)+Input!E5),2),0))

    the 2 checks i need are:
    1. Input!D5-Input!E5=0
    2. Input!G5 =1

    the first bit seems to be ok, if Input!D5-Input!E5=0 it does ROUND((Input!E5/(Input!O2/100+1)),2). If it doesnt = 0 it does ROUND((Input!E5/(Input!O2/100+1)+Input!E5

    but the second criteria seems to be letting me down, if Input!G5 is blank it is still outputting a calculated value into the cell, not the 0 i want for a false result on the if.

    hope the above makes sence. any help would be very very greatfully recieved.
    Last edited by richy1066; 10-11-2010 at 04:13 AM. Reason: solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: 2 check if statement

    It only calculates that if D5-E5 is still equal to 0... otherwise, if G5 is blank you should get 0.... Maybe you need to reverse your condtions.. the nested IFs.. work from left most to right-most.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-08-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: 2 check if statement

    doesnt seem to be doing what i'm after.

    this is where i wish excel has sql type 'then / else' commands. if Input!G5 =1 i want it to start the next set checks which is Input!D5-Input!E5=0. if Input!G5 is blank or anything but 1 i just want it reporting 0 and not bother carrying on with the next checks etc

    so if Input!G5 =1 then do the check IF(Input!D5-Input!E5=0

    if IF(Input!D5-Input!E5=0 is true, calc it this way: ROUND((Input!O2/(Input!F3/100+1)),2)
    but
    if (Input!D5-Input!E5=0 is false, calc it this way: ,ROUND((Input!O2/(Input!F3/100+1)+Input!G5),2

    not sure how to structure the nested if's or if this is even possible or a good way to do it

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: 2 check if statement

    Try:

    =IF(Input!G5=1,IF(Input!D5-Input!E5=0, ROUND((Input!E5/(Input!O2/100+1)),2),ROUND((Input!E5/(Input!O2/100+1)+Input!E5),2)),0)

    or

    =IF(Input!G5=1,ROUND((Input!E5/(Input!O2/100+1)+IF(Input!D5-Input!E5=0,0,Input!E5)),2),0)

  5. #5
    Registered User
    Join Date
    10-08-2010
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: 2 check if statement

    that did it, thank you so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1