formula to check if month and exists in Col F

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have dates in Col F onn sheet "Data"


i would like a formula to check whether a month and year exits that is linked to Cell M1 (M1 contains the month and Year) that I need to search if it exits in ColF on sheet "Data"

Your assistance is most appreciated
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

Try this to check months

Excel Formula:
=SUMPRODUCT(1*(MONTH(Data!F2:F7)=MONTH(M1)))
 
Upvote 0
This is to check for both month & year

Excel Formula:
=IF(AND(SUMPRODUCT(1*(MONTH(Data!F2:F7)=MONTH(M1))),(SUMPRODUCT(1*(YEAR(Data!F2:F7)=YEAR(M1))))),TRUE,FALSE)
 
Upvote 0
Thanks for the help. Kindly explain how the sumproduct works in this example
 
Upvote 0
It depends how M1 date is held. Assuming it is an actual date then:

Howard2.xlsx
FGLM
1DatesMonth/YearJan-21
201-Jan-20Exists?Yes
318-Mar-20How many?2
403-Jun-20
519-Aug-20
604-Nov-20
720-Jan-21
807-Apr-21
923-Jun-21
1008-Sep-21
1124-Nov-21
1230-Jan-21
1327-Apr-22
Sheet1
Cell Formulas
RangeFormula
M2M2=IF(COUNTIFS(F:F,">="&DATE(YEAR(M1),MONTH(M1),1),F:F,"<="&EOMONTH(M1,0))>0,"Yes","No")
M3M3=COUNTIFS(F:F,">="&DATE(YEAR(M1),MONTH(M1),1),F:F,"<="&EOMONTH(M1,0))
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,533
Members
448,969
Latest member
mirek8991

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