Assuming:
A1:D1 = <TABLE style="WIDTH: 248pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=328 border=0 x:str><COLGROUP><COL style="WIDTH: 62pt; mso-width-source: userset; mso-width-alt: 2998" span=4 width=82><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right width=82 height=17 x:num="39604">
5-Jun-08</TD><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" align=right width=82 x:num="39665">
5-Aug-08</TD><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" align=right width=82 x:num="39696">
5-Sep-08</TD><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" align=right width=82 x:num="39634">
5-Jul-08</TD></TR></TBODY></TABLE>
K1: N1 =
6 7 8 9
Next formula
=SUM((ISERROR(MATCH(MONTH(A1:D1),$K1:$N1,0)))*1)
gives 0
A2:D2=
<TABLE style="WIDTH: 248pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=328 border=0 x:str><COLGROUP><COL style="WIDTH: 62pt; mso-width-source: userset; mso-width-alt: 2998" span=4 width=82><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=right width=82 height=17 x:num="39604">
5-Jun-08</TD><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" align=right width=82 x:num="39543">
5-Apr-08</TD><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" align=right width=82 x:num="39696">
5-Sep-08</TD><TD class=xl24 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 62pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" align=right width=82 x:num="39634">
5-Jul-08</TD></TR></TBODY></TABLE>
K2: N2 =
6 7 8 9
Next formula
=SUM((ISERROR(MATCH(MONTH(A1:D1),$K1:$N1,0)))*1)
gives 1
If you want to use an UDF:
Code:
Option Explicit
Function Month_Check(MyRg As Range)
Dim C As Object
Dim Month_Tot(4) As Variant
Dim Month_Min As Variant
Dim A As Integer
Dim B As Integer
Dim I As Integer
Dim J As Integer
Month_Min = Month(MyRg(1))
Month_Check = 0
A = 1
For Each C In MyRg
If (Month(C.Value) < Month_Min) Then Month_Min = Month(C.Value)
A = A * Month(C.Value)
Next C
B = Month_Min * (Month_Min + 1) * (Month_Min + 2) * (Month_Min + 3)
If (A <> B) Then Month_Check = 1
End Function