Countifs with one range being an array

neilos81

New Member
Joined
Mar 8, 2022
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hi

I'm looking for some advice on a countifs function that i'm having issues with. I'm wanting to count the total number of specific grades issued to pupils from about 30 subjects (grades stored in about 30 separate columns).
The first criteria range is looking for a particular name in a column (easy) and the second needs to look across multiple columns (about 30) for a specifid grade. I want to count how many matches the criteria.

It works when it is looking at one column at a time =COUNTIFS('Sheet2'!A:A,"SpecifiedName,'Sheet2'!B:B,"SpecifiedGrade") but i need the second criteria to be lookung across 30 columns, so something like:

=COUNTIFS('Sheet2'!A:A,"SpecifiedName,'Sheet2'!B:AE,"SpecifiedGrade")

This is just throwing me a #VALUE! error - i've looked at some previous threads on sumproduct but they give an error saying it has run out of resources..!

Is there an easy and obvious solution? Any help would be muc appreciated.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUMPRODUCT((Sheet2!A2:A1000="Name")*(Sheet2!B2:AE1000="grade"))
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUMPRODUCT((Sheet2!A2:A1000="Name")*(Sheet2!B2:AE1000="grade"))
Hi, thanks for the speedy reply, I tried that also and get a processing error, as per the one below. I'm not using a particularly old computer and i get this if only try one column, never mind all 30.
1646742353821.png
 
Upvote 0
Did you use the formula exactly as I posted, or did you change it?
 
Upvote 0
Did you use the formula exactly as I posted, or did you change it?
Aha, guilty as charged...! I was using entire columns in the range (B:AE), which generally seemd works fine in countif(s). I have now added the rows in and it is working a treat! Thank you so much!
 
Upvote 0
It's always best not to use whole column references as it will slow the formulae down. Especially with array formulae.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top