+ Reply to Thread
Results 1 to 8 of 8

Nested if date less then equal today or blank

  1. #1
    Registered User
    Join Date
    02-23-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    13

    Nested if date less then equal today or blank

    I am working on a project that will require vists to be scheduled between 2 and 4 times annually i want the cell "Date of last inspection" to reflect the most current date indicated that is <= today regardless if there are blank cells in range. Curently this is what i have:
    =IF(R3<=TODAY(),R3,IF(Q3<=TODAY(),Q3,IF(P3<=TODAY(),P3,IF(O3<=TODAY(),O3,"")))) Formula results in "1/0/1900" if there are blanks


    Visits/year Date Scheduled Date of last inspection Q1 Q2 Q3 Q4
    2 5/11/13 4/25/13 2/15/13 4/25/13 5/11/13 6/11/13
    3 5/13/13 1/0/1900 2/11/13 5/13/13
    Sample.xls

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Nested if date less then equal today or blank

    Hi and welcome to the forum

    Try this array formula...
    =MAX(IF(O2:R2<=TODAY(),O2:R2,0))
    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Nested if date less then equal today or blank

    are your "Dates" actual dates or are they text....there is a function called ISDATE in 2007 and above and I don't remember if it is in 2003...if not....right click on the date cell and go to format and click general....it should come back as a number....like today is 41401....HTH
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  4. #4
    Registered User
    Join Date
    02-23-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    13

    Re: Nested if date less then equal today or blank

    Wow, you are awesome. I have been scrathing my head for hours.

    Thank you

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Nested if date less then equal today or blank

    @ judge is you look at the sample file provided by the OP, you will see that they are real dates

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Nested if date less then equal today or blank

    Happy to help. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neet and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  7. #7
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Nested if date less then equal today or blank

    @FDibbins - thanks I didn't see the sample file....thanks for the heads up....

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Nested if date less then equal today or blank

    @ judge no problem

+ 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