+ Reply to Thread
Results 1 to 9 of 9

Calculate the exact age of a referral based on date and time it was received

  1. #1
    Registered User
    Join Date
    05-12-2021
    Location
    Milton Keynes
    MS-Off Ver
    365
    Posts
    3

    Calculate the exact age of a referral based on date and time it was received

    Hi everyone,

    I am trying to create a spreadsheet that monitors SLAs that allows to identify the age of a referral based on the specific date and time it was received. The formula I have at the minute calculates the age based on the date but even the age is incorrect as it is showing something that was received yesterday i.e. 22/09/2021 as being on day 2 but in reality it would be on day 1. What I need is for something to be received 22/09/2021 09:00 as showing as day 1 from 23/09/2021 09:00 until 24/09/2021 08:59 when it would then update to day 2 at 24/09/2021 09:00 (the timer starts as soon as the referral is received). Please can somebody help with this?

    =IF(I2="Pending",NETWORKDAYS(A2,TODAY(),Dates!$D$2:$D$1000))

    The formula incorporates bank holiday dates as the timer stops over the weekend/bank holiday.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,725

    Re: Calculate the exact age of a referral based on date and time it was received

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-12-2021
    Location
    Milton Keynes
    MS-Off Ver
    365
    Posts
    3

    Re: Calculate the exact age of a referral based on date and time it was received

    Apologies, it should be attached now?
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,725

    Re: Calculate the exact age of a referral based on date and time it was received

    Where did yuo mock up (manually) the results you are looking for? I can see the formula ...

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Calculate the exact age of a referral based on date and time it was received

    I agree with Ali we really need expected results, but if you are bothered about the time in the day perhaps
    =IF(C2="Pending",NETWORKDAYS(A2,TODAY(),Dates!$D$2:$D$1000)-1+(MOD(NOW(),1)>MOD(A2,1))*1,"")

    losing a day as you wish the same day -1
    then adding a day if the time that it is now > than the time the request was received

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Calculate the exact age of a referral based on date and time it was received

    If 9:00 AM is the cut-off time, then modifying from davsth's formula:
    =IF(C2="Pending",NETWORKDAYS(A2,TODAY(),Dates!$D$2:$D$1000)-1+(9/24>MOD(A2,1))*1,"")

  7. #7
    Registered User
    Join Date
    05-12-2021
    Location
    Milton Keynes
    MS-Off Ver
    365
    Posts
    3

    Re: Calculate the exact age of a referral based on date and time it was received

    Apologies for my delayed response, I have tested the formulas provided and there doesn't appear to be any change in line with what's expected. I have attached an updated version of the sample spreadsheet with my original formula which now includes the expected result. I have added a comment on each expected result to explain why it should be like that to make it make more sense. If there is anything else I've missed please let me know and I'll look to provide it - I'm new to this sort of thing.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Calculate the exact age of a referral based on date and time it was received

    Entered cell A1 as date/time, formula for cell D3=IF(C3="Pending",NETWORKDAYS(A3,$A$1,Dates!$D$2:$D$1000)-1-IF(MOD(A3,1)>MOD($A$1,1),1,0),"").

  9. #9
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Calculate the exact age of a referral based on date and time it was received

    Change cell A1 to =NOW() to reflect current date/time.

+ 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. [SOLVED] give the exact date and time based on data provided in column
    By melody10 in forum Excel General
    Replies: 1
    Last Post: 02-09-2021, 06:00 AM
  2. Exact Date and Time compare within a range of exact date and times Lookup and Flag
    By john2001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2015, 06:01 PM
  3. Lookup to calculate Unit most likely associated based on time received
    By Viking87 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2013, 12:34 PM
  4. Calculating workdays based on date/time received
    By Sharv103 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2013, 08:46 PM
  5. Calculate ship date based on date and time order is received
    By joekomar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2013, 10:57 PM
  6. calculate the number of days from date received
    By Donna in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. calculate the number of days from date received
    By Donna in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-18-2005, 02:05 PM

Tags for this Thread

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