number of days by year

SvenB

New Member
Joined
Dec 21, 2016
Messages
28
Hello guys. I am currently facing an issue related to how to allocate the difference between some dates into specific years.
Let's assume the period below.
[TABLE="width: 500"]
<tbody>[TR]
[TD]start_date[/TD]
[TD]end_date[/TD]
[/TR]
[TR]
[TD]03-03-2015[/TD]
[TD]5-06-2017[/TD]
[/TR]
</tbody>[/TABLE]

Given this period, I would like to compute the days corresponding to each year: 2015, 2016 and 2017.

[TABLE="width: 500"]
<tbody>[TR]
[TD]2015[/TD]
[TD]2016[/TD]
[TD]2017[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

It is possible to achieve this by not doing a nested if?

Thank you.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hello guys. I am currently facing an issue related to how to allocate the difference between some dates into specific years.
Let's assume the period below.
[TABLE="width: 500"]
<tbody>[TR]
[TD]start_date[/TD]
[TD]end_date[/TD]
[/TR]
[TR]
[TD]03-03-2015[/TD]
[TD]5-06-2017[/TD]
[/TR]
</tbody>[/TABLE]

Given this period, I would like to compute the days corresponding to each year: 2015, 2016 and 2017.

[TABLE="width: 500"]
<tbody>[TR]
[TD]2015[/TD]
[TD]2016[/TD]
[TD]2017[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

It is possible to achieve this by not doing a nested if?

Thank you.

Not sure what exactly you're asking, are you trying to count the days from 03-03-2015 to 05-06-2017?
 
Upvote 0
[Table="width:, class:grid"][tr][td="bgcolor:#C0C0C0"][/td][td="bgcolor:#C0C0C0"]
A​
[/td][td="bgcolor:#C0C0C0"]
B​
[/td][td="bgcolor:#C0C0C0"]
C​
[/td][td="bgcolor:#C0C0C0"]
D​
[/td][td="bgcolor:#C0C0C0"]
E​
[/td][td="bgcolor:#C0C0C0"]
F​
[/td][td="bgcolor:#C0C0C0"]
G​
[/td][td="bgcolor:#C0C0C0"]
H​
[/td][/tr][tr][td="bgcolor:#C0C0C0"]
1​
[/td][td="bgcolor:#F3F3F3"]
Start​
[/td][td="bgcolor:#F3F3F3"]
End​
[/td][td]
2014​
[/td][td]
2015​
[/td][td]
2016​
[/td][td]
2017​
[/td][td]
2018​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
2​
[/td][td]
2015-0303​
[/td][td]
2017-0506​
[/td][td="bgcolor:#E7E7E7"]
0​
[/td][td="bgcolor:#E7E7E7"]
304​
[/td][td="bgcolor:#E7E7E7"]
366​
[/td][td="bgcolor:#E7E7E7"]
125​
[/td][td="bgcolor:#E7E7E7"]
0​
[/td][td]C2: =MAX(0, MIN($B2, DATE(C$1, 12, 32)) - MAX($A2, DATE(C$1, 1, 1)))[/td][/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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