# Calculating # of days

#### jhorness

##### New Member
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

#### texasalynn

##### Well-known Member
subtracting them and formula both return the same number
Excel Workbook
CD
234/1/2009
2412/31/2011
2510041004
Test

#### jhorness

##### New Member
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

#### al_b_cnu

##### Well-known Member
this returns 1006:

Code:
``=DATE(YEAR(TODAY())+3,1,1)-TODAY()``

#### jhorness

##### New Member
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.

#### texasalynn

##### Well-known Member
does this work

Excel Workbook
ABC
11/1/20111/1/20101/1/2009
23653661006
Sheet1

#### barry houdini

##### MrExcel MVP
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

Replies
0
Views
334
Replies
1
Views
239
Replies
6
Views
304
Replies
3
Views
332
Replies
3
Views
244

Threads
1,191,518
Messages
5,987,066
Members
440,074
Latest member
Emmanuelian

### 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

### 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