enter image description hereSimply, I have two values to lookup 1st is a name as "A" 1st is a date that I should look for its month given as "9/1/2025"

Apparently, I used these values as conditions in a COUNTIFS function for counting the relevant data in a table that includes a number of names and a number of dates

I tried using

=COUNTIFS(range_of_Names,"A",MONTH(range_of_dates),month(Date_Cell))

the result is an error message

3 Replies 3

The COUNTIFS() function works with a range for the criteria_range argument and not with an array. So, when MONTH(range_of_dates) is used it becomes an array, therefore could try using SUMPRODUCT() function here:

=SUMPRODUCT((range_of_Names="A")*(MONTH(range_of_dates)=MONTH(Date_Cell)))

Or you can use countifs with eomonth where -1 gives the end of the previous month, 0 gives the end of the current month =COUNTIFS(range_of_names,"A",range_of_dates,">="&EOMONTH(date_cell,-1)+1,range_of_dates,"<="&EOMONTH(date_cell,0))

=SUMPRODUCT(range_of_Names="A";MONTH(range_of_dates)=MONTH(Date_Cell))

or

=SUM((range_of_Names="A")*(MONTH(range_of_dates)=MONTH(Date_Cell)))

@Mayukh, isn't it?

Your Reply

By clicking “Post Your Reply”, 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.