Date Formula counting days [Closed]

Report
-
 Brande74 -
Hello,
If anyone could help me, I would greatly appreciate it, I need help with counting days if there is not an end date on the report.
Ex: Count the days from the admission date to the end of the month I am doing the report if there is no admit date. If there is an admit and discharge date would I just use the DAYS360 formula?
My work wants to know what amount of days a patient was at our hospital from admit date to discharge date but some patients haven't discharged yet so I would want to count the days from admit to the end of the month that I am doing the report. Thanks so much, Greatly appreciate for all ideas.


5 replies


So, it should calculate daily, or only when you want it to?
At the end of every month would be great.

So it is to figure what day it is, and only act when it finds out is the last day of the month?


Have you turned on the developer tab in Excel yet?
Posts
2657
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 22, 2020
440
Hey Mark, what happened to KISS?

When the admit date is in A1 and the discharge date is in B1:
=IF(B1="",DATE(YEAR(A1),MONTH(A1)+1,0)-A1,B1-A1)

Best regards,
Trowa
Blocked Profile
Exactly, that is why I asked if the tab was even ready! Nice once again!
What if there is no discharge date and I want to count from the admission date to the end of the month.
Posts
2657
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 22, 2020
440
Hi Brande,

Have you tried the formula?

When you enter for example 14-6-2018 in A1 and leave B1 blank, then result will be 16. When you enter 20-6-2018 in B1 then the result will be 6. Wasn't that what you were after?

Best regards,
Trowa
I will try it tomorrow at work, thanks much.