+ Reply to Thread
Results 1 to 5 of 5

DATEDIF Assume Today If Blank

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    San Jose, CA
    MS-Off Ver
    10
    Posts
    2

    Cool DATEDIF Assume Today If Blank

    Hi Everyone,

    I am hoping someone may be able to help me with a DATEIF formula that I am trying to incorporate a "If Blank, Assume Today" into.

    In the following example, if A2 is blank I would like Excel to assume today's date:

    =DATEDIF(A1,A2,"Y") & "y, " & DATEDIF(A1,A2,"YM") & "m "

    Thanks in advance!

  2. #2
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    292

    Re: DATEDIF Assume Today If Blank

    Try replacing A2 with If(A2=0,Today(),0) inside the formula

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    5,202

    Re: DATEDIF Assume Today If Blank

    Hello and welcome to the forum.

    Try this:

    =DATEDIF(A1,IF(A2="",TODAY(),A2),"Y") & "y, " & DATEDIF(A1,IF(A2="",TODAY(),A2),"YM") & "m "

  4. #4
    Registered User
    Join Date
    01-11-2019
    Location
    San Jose, CA
    MS-Off Ver
    10
    Posts
    2

    Re: DATEDIF Assume Today If Blank

    You are awesome! That worked perfectly...thank you so much!

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    5,202

    Re: DATEDIF Assume Today If Blank

    You're welcome. Happy to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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