+ Reply to Thread
Results 1 to 4 of 4

Having trouble with nested if commands

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Gibbons, AB
    MS-Off Ver
    Excel 2010
    Posts
    2

    Unhappy Having trouble with nested if commands

    B321= the cell above which has a date
    E13 is the cell with the end date
    If the date in B321 plus 1 month is greater than thedate in E13 I want a "-" in the field.
    For the next cell down that makes an error
    So I also want to put that if ther cell above = "-" then put a "-" in that cell.
    The first cell down where it is greater than the date in E13 works, the cells below all give me #VALUE!
    It seems to not work becasue the if fales creates a #VALUE!, but why would that matter when it should not even be looking at the if false?

    I have been trying this for hours and it is frustrating!!

    =IF(OR(B321="-",ISERROR(DATE(YEAR(B321),MONTH(B321)+1,DAY(B321)))>$E$13),"-",DATE(YEAR(B321),MONTH(B321)+1,DAY(B321)))

    Thanks for the help!

    Patrick

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

    Re: Having trouble with nested if commands

    Why doesn't this work?

    =IF(OR(B321="-",DATE(YEAR(B321),MONTH(B321)+1,DAY(B321))>$E$13),"-",DATE(YEAR(B321),MONTH(B321)+1,DAY(B321)))
    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
    09-11-2012
    Location
    Gibbons, AB
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Having trouble with nested if commands

    The DATE(YEAR(B321),MONTH(B321)+1,DAY(B321))>$E$13 creates a #VALUE! and for some reason it is ignoring the IF(OR(B321="-" and I think it is because of the error. It seems like it should work to me too, I have tried the iferror command as well and it does not help either.

    E13 Oct 5, 2037

    B320 Oct 5, 2037
    B321 -
    B322 #VALUE!

    That is what I keep getting

    Pat
    Last edited by pmilligan1979; 09-11-2012 at 12:30 PM. Reason: missed a (, and entered a year wrong

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

    Re: Having trouble with nested if commands

    How about?

    =IF(ISERROR(DATE(YEAR(B321),MONTH(B321)+1,DAY(B321))),"-",IF(OR(B321="-",DATE(YEAR(B321),MONTH(B321)+1,DAY(B321))>$E$13),"-",DATE(YEAR(B321),MONTH(B321)+1,DAY(B321))))

+ 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