0

I have two sets of dates (yyyy/mm/dd) in two columns, I want to check if the dates are the same or not. I tried the following line of code and it doesn't seem to work

If (Application.WorksheetFunction.CountIfs(completed.Columns(2), "=", row.Columns(5))) Then

Is it possible to compare two sets of dates with CountIfs?

1 Answer 1

1

yes, it is possible to count the number of matching dates. but the countifs format should be followed correctly. May be you need some thing like below. please check your other code accordingly.

If (Application.WorksheetFunction.CountIfs(Range(completed.Columns(2)),row.Columns(5).value) = row.Columns(5)) Then

Format to use CountIfs

CountIfs(Range to check as range, Argument as value)
Sign up to request clarification or add additional context in comments.

2 Comments

alternatively, why cant you use just a comparison of values? any limitation?
do you get an error for correct format of Countifs or you tried to compare the values? If you were trying to compare values, share your code to verify.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.