How to check if a date is in the current month in Excel
Formula (Excel and Google Sheets)
=IF(EOMONTH(B2,0)=EOMONTH($F$1,0),"Yes","No")Compare month ends: =IF(EOMONTH(B2,0)=EOMONTH($F$1,0),"Yes","No") checks the month and the year at once, with today in F1.
- Result on the example
- one result per row in
C2, filled down toC7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in C2, filled down to C7. Change any input and the result updates, or edit the formula to experiment.
How it works
Every date in a month shares the same month end, so comparing EOMONTH of the date with EOMONTH of today checks the month and the year in one test. October 15, 2025 has a different month end, so it doesn't count. Put =TODAY() in F1 for a live report.
=IF(EOMONTH(B2,0)=EOMONTH($F$1,0),"Yes","No")Result"Yes"
B210/1/2026The value in B2.
EOMONTH(B2,0)10/31/2026 (46326)EOMONTH: Last day of the month, months away.- start_date
B210/1/2026 - months
0
- start_date
$F$110/29/2026The value in F1.
EOMONTH($F$1,0)10/31/2026 (46326)EOMONTH: Last day of the month, months away.- start_date
$F$110/29/2026 - months
0
- start_date
EOMONTH(B2,0)=EOMONTH($F$1,0)TRUEThe = operator tests whether the two sides are equal.
IF(EOMONTH(B2,0)=EOMONTH($F$1,0),"Yes","No")"Yes"IF: Returns one value if a test is true, another if false.- logical_test
EOMONTH(B2,0)=EOMONTH($F$1,0)TRUE - value_if_true
"Yes" - value_if_false
"No"not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(EOMONTH(B2,0)=EOMONTH($F$1,0),"Yes","No"). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(AND(MONTH(B2)=MONTH($F$1),YEAR(B2)=YEAR($F$1)),"Yes","No") | Yes, No, Yes… | Compares the month and the year separately. |
| =IF(TEXT(B2,"yyyymm")=TEXT($F$1,"yyyymm"),"Yes","No") | Yes, No, Yes… | Compares a year-month code like 202610. |
| =IF(MONTH(B2)=MONTH($F$1),"Yes","No") | Yes, No, Yes…Different result | A common mistake: it ignores the year. October 2025 counts too. |
Common mistakes
- Comparing MONTH alone matches the same month in every year.
- For "this month so far", also require
B2<=$F$1, which drops future-dated rows.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Check if a date is in the current month
C2, show "Yes" if the date is in the same month and year as the date in F1, and "No" otherwise. Fill down to C7.Questions
How do I check if a date is in last month?
=EOMONTH(B2,0)=EOMONTH($F$1,-1).
How do I check if a date is in the current week?
Compare the week starts: =B2-WEEKDAY(B2,3)=$F$1-WEEKDAY($F$1,3).
How do I count this month's invoices?
Count dates after last month's end and up to this month's: =COUNTIFS(B2:B7,">"&EOMONTH(F1,-1),B2:B7,"<="&EOMONTH(F1,0)).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.