Identifying if 2 dates are alike and entering the appropriate month

Gordon1963

New Member
Joined
Oct 18, 2017
Messages
18
I have spreadsheet similar to this:

This Year Last Year
Date Event Date Event
3/1/17 Event 1 March 3/6/16 Event 1
5/6/17 Event 2 May
4/12/17 Event 3 April 4/15/16 Event 3
February 2/20/17 Event 4

I need a formula to look at This Year event 1 date and last year event 1 date and tell me the month. Where it gets tricky, if this year had an event and last year didn't it should give me this year event month and likewise if this year didn't have an event. See above how the month should be displayed.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Assuming there will always be at least one date specified per event, you could do something like this:

E3: =TEXT(IF(ISBLANK(B3),C3,B3),"MMMM") copy down the column


Excel 2010
ABCDE
1This YearLast YearMonth
2EventDateDate
3Event 11 Mar 20176 Mar 2016March
4Event 26 May 2017May
5Event 315 Apr 2016April
Sheet1


But what if the months for 2016 and 2017 are different, e.g. as would often be the case for an Easter event?
 
Last edited:
Upvote 0
Stephen-Thanks! It works. As for Easter or other events, if it falls in another week or month, both events would be on separate weeks or month.
 
Upvote 0
Stephen or All,

I'm in retail so we use 4-5-4 calendar, so to get the correct month for each event on the same line, so I placed 2 columns between both years and used the following formula:

This is 2017 =TEXT(DATE(YEAR(C9),MATCH(C9-DATE(YEAR(C9),1,0),{0,29,64,92,120,155,183,211,246,274,302,337,365}),1),"mmmm")

This is 2016 =TEXT(DATE(YEAR(C9),MATCH(C9-DATE(YEAR(C9),1,0),{0,31,66,94,122,157,185,213,248,276,304,339,367}),1),"mmmm")

However, if a row is blank, it enters January, so this formula I received from Stephen above =TEXT(IF(ISBLANK(B3),C3,B3),"MMMM") doesn't work because the 4-5-4 formula above puts in January in the blank column on one side and the correct month on the other so I received a false. How can I get the 4-5-4 formula to leave that cell blank? or can I combine both formulas somehow>
 
Upvote 0
Perhaps something like this:

B2: =IF(ISBLANK(A2),"",TEXT(DATE(YEAR(A2),MATCH(A2-DATE(YEAR(A2),1,0),{0,29,64,92,120,155,183,211,246,274,302,337,365}),1),"mmmm"))

E2: =IF(ISBLANK(D2),"",TEXT(DATE(YEAR(D2),MATCH(D2-DATE(YEAR(D2),1,0),{0,31,66,94,122,157,185,213,248,276,304,339,367}),1),"mmmm"))

G2: =IF(B2="",E2,B2)


Excel 2010
ABCDEFG
12017 date4-5-4 month2016 date4-5-4 monthResult
21 Mar 2017February6 Mar 2016MarchFebruary
315 Apr 2016AprilApril
41 Apr 2017MarchMarch
Sheet1
 
Last edited:
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