Calculating # of days

jhorness

New Member
Joined
Sep 13, 2007
Messages
25
I have two inputs, the date the equipment goes out and the date the equipment comes back in. I know I can subtract the two dates to get the total # of days, but what I need to do is calculate the number of days per year.

Ex) Say the out date is 4/1/09 and the in date is 12/31/2011. I need to calculate the number of days for 2009, 2010, and 2011.

I'm drawing a blank. Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I need to calculate how many days are in 2009, 2010, 2011. I know that the total number of days is 1004, but 275 are in 2009, 365 days each for 2010 and 2011. Anybody know how I can do this? Thanks
 
Upvote 0
This doesn't get me to the count of days for 2009, 2010, 2011.

If I enter the dates of 4/1/09 to 12/31/2010, I need the output to look like:

2009 2010 2011
# of days 275 365 365

I just don't know what formula to use to get to 275, 365, 365.
 
Upvote 0
Try like this...see below

D1:H1 are just years as numbers as displayed, not dates...

Formula in D2 copied across and down

=MAX(0,MIN($B2+1,DATE(D$1+1,1,1))-MAX($A2,DATE(D$1,1,1)))
Book3
ABCDEFGHI
1InOut20092010201120122013
201-Apr-0931-Dec-1127536536500
313-Mar-0931-Mar-1329436536536690
4
5
Sheet3
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,405
Members
448,958
Latest member
Hat4Life

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