+ Reply to Thread
Results 1 to 10 of 10

calculating amount of days

  1. #1
    Registered User
    Join Date
    07-01-2020
    Location
    Nottingham, UK
    MS-Off Ver
    2010
    Posts
    9

    calculating amount of days

    Hi

    I am making a spreadsheet to record patients in my clinic. I can easily work out how long a patient has been in my clinic using =DATEDIF(K5,TODAY(),"y") &" years, "&DATEDIF(K5,TODAY(),"ym")&" months". where K5 is the date first seen in the clinic.

    However, patients will eventually leave the clinic (either death or disease progression, so i will put the date of their last clinic in a different cell (say P5). at that point i want the amount of time in my clinic to stop ie stop using TODAY and use the date in P5.

    Can the above formula be adapted to use P5 instead of TODAY when a value is put in P5?

    Hope this is clear.... newbie here!

    EK

  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
    79,369

    Re: calculating amount of days

    Welcome to the forum.

    Try this:

    =DATEDIF(K5,IF(P5="",TODAY(),P5),"y") &" years, "&DATEDIF(K5,IF(P5="",TODAY(),P5),"ym")&" months"
    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
    07-01-2020
    Location
    Nottingham, UK
    MS-Off Ver
    2010
    Posts
    9

    Re: calculating amount of days

    Thank you

    As a follow on, can a third cell s5 be added into the formula, so either overrides TODAY?

  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
    79,369

    Re: calculating amount of days

    Yes. However, I'd need to know the exact criteria.

  5. #5
    Registered User
    Join Date
    07-01-2020
    Location
    Nottingham, UK
    MS-Off Ver
    2010
    Posts
    9

    Re: calculating amount of days

    one is disease progression date (P5), the other death of date (S5).
    only one would be ever completed as the they can't do both whilst in the clinic: they either leave the clinic as they progress, or they leave the clinic when they die. not everyone progresses.

  6. #6
    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
    79,369

    Re: calculating amount of days

    OK, then try this:

    =DATEDIF(K5,IF(P5<>"",P5,IF(S5<>"",S5,TODAY())),"y") &" years, "&DATEDIF(K5,IF(P5<>"",P5,IF(S5<>"",S5,TODAY())),"ym")&" months"

    I am a Derby girl by birth - just down the A52!!!

  7. #7
    Registered User
    Join Date
    07-01-2020
    Location
    Nottingham, UK
    MS-Off Ver
    2010
    Posts
    9

    Re: calculating amount of days

    Thank you again.

  8. #8
    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
    79,369

    Re: calculating amount of days

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

  9. #9
    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
    79,369

    Re: calculating amount of days

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new, I will do it for you this time: https://www.mrexcel.com/board/thread...dates.1138922/.)

  10. #10
    Registered User
    Join Date
    07-01-2020
    Location
    Nottingham, UK
    MS-Off Ver
    2010
    Posts
    9

    Re: calculating amount of days

    My apologies, won't do that again

+ 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 amount per bed in bands with max amount
    By bigbread in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-02-2020, 01:00 PM
  2. [SOLVED] Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates
    By hecgroups in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-23-2019, 12:09 AM
  3. [SOLVED] Calculate a date dervied from 3 cells + calculating the amount of spec days.
    By RachelMads02 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-02-2016, 09:57 AM
  4. [SOLVED] Calculating number of months given a set amount of days
    By jacobus1231 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-12-2016, 05:35 AM
  5. Replies: 0
    Last Post: 10-31-2014, 10:32 AM
  6. [SOLVED] DATE: Calculating date after "x" amount of days
    By myoung5149 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-11-2014, 02:30 PM

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