+ Reply to Thread
Results 1 to 7 of 7

IFTHEN Statements and Dates

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    IFTHEN Statements and Dates

    I want a cell to reference two other cells and produce an estimated date based on their contents or lack thereof. So let me see if I can explain this......

    I have a Cell (P9) that I want to generate an inspection date. The date will always be 365 days from the previous inspection date (J9). But forecasting purposes I may have to use estimated dates (I9). So i want P9 to look at J9 and say if there is a date entered in that cell, then use it+365 days. If not, then use I9+365 days. As soon as i come along and enter the actual date of the inspection in J9, then P9 would update itself with a new estimated date.


    Here is what I have so far in cell P9: =IF(J9,BLANK,I9+365)

    After that I have had zero luck nesting another IF statement.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: IFTHEN Statements and Dates

    Maybe:
    =IF(J9<>"",EDATE(J9,12),EDATE(I9,12))

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: IFTHEN Statements and Dates

    Hello,

    I believe the below formula will do it for you

    =IF(ISBLANK(J9),I9+365,J9+365)

    Thanks!

  4. #4
    Registered User
    Join Date
    03-01-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: IFTHEN Statements and Dates

    Both of those solutions worked!!!

    ISBLANK is one I was trying use earlier, but was just plan using it wrong. EDATE I have never heard of before.

    Thanks to both of you!

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: IFTHEN Statements and Dates

    You're welcome, thanks for the 'star tap'.

    I think EDATE was part of the Analysis Tool Pack until Excel 2007 when it was included as a standard function. It is handy because you don't have to consider leap years.

  6. #6
    Registered User
    Join Date
    03-01-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: IFTHEN Statements and Dates

    Could this be taken one more cell deep? How would I nest one more IF inside of this?

    Cell H23 is looking at M11. If M11 is populated it takes that date and adds 6 months. If M11 is blank, it looks at I11. If I11 is populated it takes that date and adds 12 months. If I11 is blank, it looks at H11 and adds 12 months.

    I tried it a couple ways but I kee getting a "too many arguments for this function" message.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: IFTHEN Statements and Dates

    Try
    =IF(M11<>"",EDATE(M11,6),IF(I11<>"",EDATE(I11,12),EDATE(H11,12)))

+ 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