+ Reply to Thread
Results 1 to 3 of 3

Days between dates, blank if one or both columns have no date

  1. #1
    Registered User
    Join Date
    11-18-2004
    Location
    Louisville, KY, USA
    MS-Off Ver
    2010
    Posts
    26

    Days between dates, blank if one or both columns have no date

    I'm attempting to write a formula that will allow me to determine the number of days between two dates but to leave the cell with a zero in it if either of the first two date cells are blank or have N/A in them. Here's what I have so far:

    =IF(AND(K5="N/A",L5="N/A"),0,L5-K5)

    This will give me a zero in the cell if both date cells are blank or will give me the days between if not. How do I get it to also put a zero in the cell if only one of the date cells is blank?

    Any help or information is greatly appreciated. Thanks.

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Days between dates, blank if one or both columns have no date

    Use OR() instead of AND(). That will deliver a TRUE if any of the nested conditions are TRUE; the AND function will only deliver TRUE if all the nested conditions are TRUE.

  3. #3
    Registered User
    Join Date
    11-18-2004
    Location
    Louisville, KY, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Days between dates, blank if one or both columns have no date

    Quote Originally Posted by ben_hensel View Post
    Use OR() instead of AND(). That will deliver a TRUE if any of the nested conditions are TRUE; the AND function will only deliver TRUE if all the nested conditions are TRUE.
    Greatly appreciated, thanks. Works like a charm.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-20-2014, 06:40 AM
  2. Replies: 8
    Last Post: 02-08-2013, 04:29 AM
  3. Replies: 0
    Last Post: 02-01-2013, 05:10 PM
  4. [SOLVED] Number of Days Between Dates but if no Date go to next and return # of Days
    By Bikeman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-14-2012, 12:02 PM
  5. [SOLVED] Number of days between 2 dates, if end date is blank assume todays
    By JulesM in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-01-2006, 08:45 AM

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