Go Back

Date is same month

How do you tell if dates share the same month a year in excel? You can test is Date is same month and year very easily by applying the MONTH and YEAR functions. The functions make a perfect formula for this kind of problem. Check out how the formula looks like:

Formula

Then generic syntax for this formula is:

=MONTH(date1)&YEAR(date2)=MONTH(date1)&YEAR(date2)

Explanation

Firstly, the working of the formula to check if the date is the same month and year is not as complicated as it appears. What happens is that the month number and year values are extracted from the date values in cell references like B2 and C2, and then put together in series to form a chain of text using concatenation operator Ampersand (&).

A similar thing is done of the other side of the equation where the month and year values are extracted from date values in cell references B2 and C2 are also joined together. Then, the formula is tested if both sides are equal using the equal(=) sign.

Example

Assume that you have two sets of dates and can’t tell whether they share same month and year. With Excel, checking if the date is the same month and year is very easy. Therefore, we’re going to use the formula described above.

From the above example, the formula in the highlighted cell (D10) is:

=MONTH(B9)&YEAR(B9)=MONTH(C9)&YEAR(C9)

If you look at dates of row 9, you will notice that they are in January of 2011. Therefore, the formula returns TRUE. The following step will present the solution:

=MONTH(B9)&YEAR(B9)=MONTH(C9)&YEAR(C9)

=1&2011=1&2011

=”1201”=”1201”

=TRUE

Figure 1. Example 1 of MONTH/YEAR Function

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I have two columns which add up the above What I want is an array fomula in a cell to add up the values in the amount_GBP range if the month of the invoice date is the same as the month in $A$3 AND if the value in the sales type range is the same as the value in $B$4
Solved by V. U. in 25 mins
Based on date of arrival 1/20/19 I need a formula that will choose only even months following the date of arrival. Based on this information: If next even month is greater than 1 month up to 3 months from arrival date than soonest even month is chosen If arrival date is less than 4 weeks from next even month than use the following even month (ie. MARCH 2019 is the month that needs to be chosen for the above date of arrival)
Solved by S. B. in 12 mins
I have a report that shows each month separate that throughout the month needs to have the current date, but the date needs to stop at the end of the month. (ex: current date is 4-10, on 5-3 the date needs to stop at 4-30 in that column) Is there an "end of month" stop date formula?
Solved by F. Q. in 15 mins

Leave a Comment

avatar