+ Reply to Thread
Results 1 to 6 of 6

Nested IF statement

  1. #1
    Registered User
    Join Date
    02-05-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Nested IF statement

    Hello all,

    Thi is my first post so hello to all and thank you for reading!

    Basically, I have a spreadsheet which features dates. If the second date (J3) is greater than the first date (H3), then I would like the third cell (named 'deduction' to show 'Yes', otherwise, the deduction cell should show 'No'. This bit I have no problem with and I have used the following formula:

    Please Login or Register  to view this content.
    However, when I drag the 'deduction' formula down the column, where there is no date in column J, the 'deduction' cell displays 'No'. However, where there is no date in column J I would like the 'deduction' cell to remain blank.

    I think this can be resolved by adding and 'AND' into the if statement, but can't quite work it out. Any suggestions muchly appreciated.

    Hope that makes sense!

    Quercus
    Last edited by quercus23; 02-05-2009 at 09:28 AM.

  2. #2
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153

    Re: Nested IF statement

    Hi,

    Try this formula:
    Please Login or Register  to view this content.
    Please check this post on nested IF function:

    http://www.exceldigest.com/myblog/20...e-if-function/

    Regards.
    Welcome to: http://www.exceldigest.com/myblog/
    "Excel help for the rest of us"

  3. #3
    Registered User
    Join Date
    02-05-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Nested IF statement

    Quote Originally Posted by se1429 View Post
    Hi,

    Try this formula:
    Please Login or Register  to view this content.
    Please check this post on nested IF function:

    http://www.exceldigest.com/myblog/20...e-if-function/

    Regards.
    Hmmm, I thought that had worked, but, when I now enter a value in J3, it appears to bring up 'No' regardless of whether it is greater or less than H3
    Last edited by quercus23; 02-05-2009 at 09:24 AM.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Nested IF statement

    quercus23,

    note that:

    " " as per se1429 formula is in fact a Space as opposed to a traditional Null value which would be ""

    =IF(ISBLANK(J3),"",IF(J3>H3,"Yes","No"))

    Also depending on how J3 is populated it may be you'd want to use:

    =IF(ISNUMBER(J3),IF(J3>H3,"Yes","No"),"")

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

    Re: Nested IF statement

    The " " is actually putting a space in the cell... but I think you want to leave it blank (no spaces...no nothing....) because the space may cause you problems later....

    Change it slightly to (changing " " to "")

    =IF(ISBLANK(J3);"";(IF(J3>H3;"Yes";"No")))

    this puts a null and tells excel the cell is blank, not containing any spaces, etc.
    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.

  6. #6
    Registered User
    Join Date
    02-05-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Nested IF statement

    sweet - when I remove the space it sorts the issue!

    Thanks again folks - much appreciated

+ 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