I have a list of date in A3:A13 and 1 date in C1
All dates are formatted as dd/mm/yyy
I try to countif as follow:
=COUNTIF(A3:A13,"<="&C1)
it is OK
but try with VBA:
it returns wrong resultSub a() Dim adate As Range Dim n As Long Set adate = Range("A3:A13") n = WorksheetFunction.CountIf(ngay, "<=" & Range("C1")) Debug.Print n End Sub
See attachment.
Anybody can help?
Bookmarks