Home » excel » excel – Count the number of time text is seen, which also meets another criteria

excel – Count the number of time text is seen, which also meets another criteria

Posted by: admin May 14, 2020 Leave a comment

Questions:

I would like to count the number of times a value occurs with multiple columns if another column shows a particular value.

any help would be appreciated!

So I have tried various formulas, each giving me an error code or #value! –
the data I wish to count is within columns D2:F50 and the other column I wish to include is column J2:J50 (if value in J is “Y” then count the number of times value occurs in columns D:F).

This formula returns a #VALUE! =COUNTIFS($D$2:$F$50,D120,J$2:J$50,”Y”)

The code I expect to count the number of times the value of cell D120 appears in columns D:F if the corresponding cell in column J is “Y”.

I keep getting error messages, I think it might be due to the ranges not being the same? I just cannot get it to do what I require.

Thanks for any help in advance!

Regards,

How to&Answers:

As per my comment:

The reason for your error is that COUNTIFS does expect you to inspect ranges of the same size for criteria. Right now that’s not what you are trying. Instead try:

=SUMPRODUCT((D2:F50=D120)*(J2:J50="Y"))