How to calculate a full year date difference?

riaz

Well-known Member
Joined
Jun 27, 2006
Messages
779
I have a report that usually covers a full year (1 Jan to 31 Dec). Sometimes it may start or end at dates other than these two, so my header would change to "period" instead of "year".

A difference between the two, gives 365 in leap years and 364 in normal years, so that is not a useful test.

What can I use to get Excel to recognise that 1 Jan to 31 Dec is a full year, anything else is not?
 

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
try :-

where F21 contains the end of your "year" and F22 the start of your "year".

=IF(AND(DAY(F21)=31,MONTH(F21)=12,DAY(F22)=1,MONTH(F22)=1),"FULL YEAR","PERIOD")

Thanks

Kaps
 
Upvote 0
Assuming dates in A1 and B1, how about:
=DATE(YEAR(A1)+1,MONTH(A1),DAY(A1))-1=B1

PS There's no acute accent in 'manger'.
 
Upvote 0
Resolved Re: How to calculate a full year date difference?

Kaps, Rory, thank you both. Rory, I have to put in an IF statement to use yours, but both work fine. Spoilt for choice I am, I think I will count the letters in the formulae and use the one where I have to type less :LOL:

And Rory, signature edited, thanks. I'm no francophone... (are you?)
 
Upvote 0
Re: Resolved Re: How to calculate a full year date difference?

I have my moments! :)
 
Upvote 0
My preference is for

To the water - This is the hour!!
(â l'eau, c'est l'heure)
 
Upvote 0
The less said about that, the better! :)
 
Upvote 0
Mr. Riaz - dont forget that this thread is *not* in the lounge and also that you initially asked a question. Let it be a question :LOL:
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,060
Latest member
mtsheetz

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