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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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
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,215,731
Messages
6,126,537
Members
449,316
Latest member
sravya

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