Excel function to determine how many days in year YYYY

CD2017

New Member
Joined
Feb 21, 2017
Messages
33
Hello,

I need to determine whether my daycount should be 365 or 366 depending on the year. For example in 2016 it was 366 and in 2017 it's 365.

Is there a function which will do this?

Thanks,
Clare
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I should have said. There will be a cell containing the year 2016, and I want a formula to determine how many days are in that year.

Thanks![

QUOTE=CD2017;4821450]Hello,

I need to determine whether my daycount should be 365 or 366 depending on the year. For example in 2016 it was 366 and in 2017 it's 365.

Is there a function which will do this?

Thanks,
Clare[/QUOTE]
 
Upvote 0
Try where E1 has the year
Code:
=DATE(E1,12,31)-DATE(E1,1,1)+1
 
Upvote 0

Excel 2010
EF
12016366
2TRUE
3366
4
3d
Cell Formulas
RangeFormula
F1=DATE(E1,12,31)-DATE(E1,1,0)
F2=DAY(DATE(E1,3,0))=29
F3=365+(DAY(DATE(E1,3,0))=29)
 
Upvote 0
Excel 2010
EF

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]2016[/TD]
[TD="align: right"]366[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"]TRUE[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"][/TD]
[TD="align: right"]366[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
3d

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]F1[/TH]
[TD="align: left"]=DATE(E1,12,31)-DATE(E1,1,0)[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]F2[/TH]
[TD="align: left"]=DAY(DATE(E1,3,0))=29[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]F3[/TH]
[TD="align: left"]=365+(DAY(DATE(E1,3,0))=29)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Just a warning
https://support.microsoft.com/pt-br...tly-assumes-that-the-year-1900-is-a-leap-year

M.
 
Upvote 0
I suggest this formula
=IF(MOD(E1,100)=0,IF(MOD(E1,400)=0,366,365),IF(MOD(E1,4)=0,366,365))

M.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
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