+ Reply to Thread
Results 1 to 5 of 5

calculating date differences

  1. #1
    Registered User
    Join Date
    03-04-2020
    Location
    uk
    MS-Off Ver
    office 365 business
    Posts
    3

    calculating date differences

    Hi Guys

    I'm a newbie here, and a very basic excel user, so please excuse if this is a daft question...

    I'm trying to devise a method of reporting delays on a construction project due to lack of timely information.

    In simple terms, a specific query is raised, and a drop dead date for an answer is required. More often than not the date for that answer is exceeded, creating a delay.

    I can create a simple formula subtracting one date from another, eg =A2-A1, where A1 is the date required and A2 is the date received. - however, that only works when both dates are known.

    For example, if I request an answer by 13th March, and receive the answer on 20th March, that creates a 7 day delay; conversely if I receive an answer on 11th March it should generate a 2 day saving (in practice no savings are actually generated, so in that case I would want the result to be zero)
    However, I cannot enter a date value until I actually receive a response, and in that case I believe excel defaults to 1st Jan 1900.
    On that basis my required date of 13th March against an answered date of 1st Jan 1900 generates a value of -43903 days...

    How do I get around this?

    Any assistance would be greatly appreciated.

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: calculating date differences

    Perhaps utilizing some if statements and the TODAY() function.
    Try this formula below.

    =IF(IF(A2="",TODAY()-A1,A2-A1)<0,0,IF(A2="",TODAY()-A1,A2-A1))

    This states if there is no data in A2 then take todays date and subtract by date required. The first IF statement says that if A2-A1 is less than 0 or a (savings) as you put it, then to return 0. So usuing your 3/13/20 example, this will return 0 until a date is put into A2 or todays date is 3/14/20 or later
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  3. #3
    Registered User
    Join Date
    03-04-2020
    Location
    uk
    MS-Off Ver
    office 365 business
    Posts
    3

    Re: calculating date differences

    Dosydos, Thank you for advice - you've cooked my brain with that formula, but it worked a treat, thank you.

    One more question, sorry.

    As I'm creating a template (which will have formulae, but no values) for others to complete, are you able to show me a formula to avoid the default 1st Jan 1900 if neither date are entered.

    If I use your formula when neither A1 nor A2 have entered values, then the default 1st Jan 1900 comes into play again...

    Any advice greatly appreciated

  4. #4
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: calculating date differences

    =IF(A1="","",IF(IF(A2="",TODAY()-A1,A2-A1)<0,0,IF(A2="",TODAY()-A1,A2-A1)))

    this will make it if A1 has no value then the answer will just be blank.
    **I am under the assumption that if A1 is blank A2 will ALWAYS be blank

  5. #5
    Registered User
    Join Date
    03-04-2020
    Location
    uk
    MS-Off Ver
    office 365 business
    Posts
    3

    Re: calculating date differences

    Dosydos, I am indebted to you, and I wish I had your logical mind. Thank you, this has worked a treat.

+ 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. calculating differences
    By bluesky in forum Excel General
    Replies: 2
    Last Post: 04-16-2009, 11:06 PM
  2. Calculating Date Differences
    By ignax in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-03-2007, 12:00 AM
  3. Calculating time differences
    By WaySlowWhitey in forum Excel General
    Replies: 3
    Last Post: 10-22-2007, 10:26 AM
  4. Calculating Date AND Time Differences
    By Lea777 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2006, 12:25 PM
  5. Calculating Differences Uniformly
    By tx12345 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-30-2005, 11:49 PM
  6. Calculating differences in dates
    By Paul Sheppard in forum Excel General
    Replies: 5
    Last Post: 06-30-2005, 09:05 AM
  7. [SOLVED] Calculating differences between dates
    By ALISONHELP in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-06-2005, 06:06 AM
  8. [SOLVED] Calculating Time and Date Differences
    By Darran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2005, 09:56 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