Calculating number of days when you don't have an end date

ExcelGirl_215

New Member
Joined
Sep 5, 2013
Messages
4
I need to determine how many days during a month a person was in our program. For instance, if someone is in the program from 1/1/2013 to 4/5/2013, then he/she was here 31 days in January, 28 in February, 30 in March, and 5 in April.

The issue I’m running into is that some people do not have an end date because they are currently in the program. So if someone began the program on 1/1/2013 and is still in the program (i.e., has no end date), they would have 31 days in Jan, 28 in Feb, 30 in March, and 30 in April (and so on). However, I’m not sure how to create a formula that will account for the lack of an end date for most of the people in the spreadsheet.

Any ideas??
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
PUT =TODAY() in a cell, say A1

Then whereever in your formula you refer to the end date, I am going to use E1 in this example, instead of E1, use MAX(E1,A1)
 
Upvote 0
Can you post a formula you already have that gives the desired result when there IS an end date?

Should be easy enough to do something like

IF(B1="",TODAY(),B1)

If B1 is supposed to be the end date, then it substitutes B1 with today's date when B1 is empty.
 
Upvote 0
Hi,

Assuming all available end dates are before 'today', maybe:

Excel 2013
ABCDE
1Start dateEnd dateDaysToday
201/01/201304/05/20139409/05/2013
301/01/2013247

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E2=TODAY()
C2=MIN(B2, E$2) - A2

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Thanks everyone for your speedy help!

This is the formula I'm using right now (with the date changed for each month)

=MAX(MIN(D9+1, "7/31/2013"+1),C9) - MIN(MAX(C9,"7/1/2013"),D9+1)

Where D9 is the end date in the program and C9 is the start date. This yields the correct number of days someone was in the program when they have an end date.
 
Upvote 0
F16= Start date
G16= End Date

=NETWORKDAYS(F16,IF(ISBLANK(G16),TODAY(),G16))

If you end date is blank (they are still working for you) then it will give the number of days that they have worked between their start day and the current date.
 
Upvote 0
Then you can apply the logic as such

=MAX(MIN(IF(D9="",TODAY(),D9)+1, "7/31/2013"+1),C9) - MIN(MAX(C9,"7/1/2013"),IF(D9="",TODAY(),D9)+1)

or using min as others suggested

=MAX(MIN(MIN(TODAY(),D9)+1, "7/31/2013"+1),C9) - MIN(MAX(C9,"7/1/2013"),MIN(TODAY(),D9)+1)
 
Upvote 0
Glad to help, thanks for the feedback...


Actually, I think that should have been MAX, not MIN...
=MAX(MIN(MAX(TODAY(),D9)+1, "7/31/2013"+1),C9) - MIN(MAX(C9,"7/1/2013"),MAX(TODAY(),D9)+1)

but anyway, glad you got it working.
 
Upvote 0
The first formula worked, but this one just says everyone has 31 days in July...so I'm going to stick with the first one :)

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top