+ Reply to Thread
Results 1 to 4 of 4

"IF()" function using "TODAY()" to produce a value in days

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    32

    "IF()" function using "TODAY()" to produce a value in days

    Hi,

    I'm a little stumped on why the formula I've created only half works.

    =IF(N5=" ",TODAY()-K5,N5-K5)

    The intent here is the following.

    I have three columns, first being the "start date" of a task, the second being the "end date", and lastly a "how many days have passed since the start date".

    So the last column is supposed to do the following: If N5 (end date) is empty, show how many days have passed by taking today's date and subtracting K5 (start date).

    Here's the problem. The "False" value is showing perfectly, but the "Today()-K5" is showing a -41207 value.

    Anyone able to provide a little advice on this formula?

    Greatly appreciated in advance.

    Rob.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,715

    Re: "IF()" function using "TODAY()" to produce a value in days

    Hello Rob, "blank" should be "" not " " so try this small change

    =IF(N5="",TODAY()-K5,N5-K5)
    Audere est facere

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: "IF()" function using "TODAY()" to produce a value in days

    You are not testing for an empty cell (""), you are testing for N5 containing a space (" "). Remove the space between the two quotes in your formula.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    11-06-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: "IF()" function using "TODAY()" to produce a value in days

    Oh wow. Here I was looking for some complex issue and it just something I should have already known! Appreciate the help all the same! Thanks guys.

+ 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