Countifs / sumifs

Gwill1983

Board Regular
Joined
Oct 24, 2018
Messages
123
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am struggling a little to make a COUNTIFS or SUMIFS formula work on my spreadsheet.

I am trying to count the amount of errors made depending on the category. I have the scores in one tab and the table containing the number of errors in another.

So.... My current formula is below:

=IFERROR(COUNTIFS('Scores - 2019'!A:A,R11,'Scores - 2019'!P:T,"=No"),0)

In essence, the Scores - 2019 tab contains the scores that I am trying to count.

Column A contains the name of the category
R11 is the reference of the category in the current tab
Column P:T in the scores contains the yes/no if there is an error

In the scores table I have adjusted the cells so that 1 shows as Yes and 0 shows as No. Not sure if this is what is stopping the formula.

Currently everything is showing as 0 even though there are some errors to count.

Any help would be much appreciated.

Chris
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
its battter post your some data and what result u want if u want to get batter formula
 
Upvote 0
Hi,

Below is an example of the table where I want the errors to be counted.
Column 1 is column R on my sheet, Row 1 is row 4 on my sheet. Columns 2-4 are staff members

Category 1
Category 2
Category 3
Category 4
Category 5
Category 6
Category 7
Category 8
Category 9
Category 10
Category 11
Category 12
Category 13

<tbody>
</tbody>


My other sheet is very difficult to put in here as it is very large.

I will try to summarise below:

DayMondayTuesWedThursFri
Date
Event
Category 1

<tbody>
</tbody>
Y
Cat 2
Cat 3
Cat 4
Cat 5
Cat 6
Cat 7
Cat 8
Cat 9
Cat 10
Cat 11
Cat 12
Cat 13

<tbody>
</tbody>

Column 1 is A and 1st row is 2, There are 2 blank column between the categories and the results. The results start in column D row 7 (cell highlighted with Y above)
These results are marked either with a 1 or 0 (1 changes to Yes, 0 changes to No)
This part of the sheet duplicates 52 times (for each week of the year)

I am trying to get cell S4 on the first sheet to show me the number of No's against category 1 in the results spreadsheet for the entire year!

I cannot work out if COUNTIFS or SUMIFS is the correct formula to use!

Chris
 
Last edited:
Upvote 0
What exactly does this mean: "I have adjusted the cells so that 1 shows as Yes and 0 shows as No"?

If you've applied a custom number format, the COUNTIFS formula needs to use the value of the cell as the criteria (I.e. 1 or 0) not the displayed text.
 
Upvote 0
Hi Rory,

Exactly right. It is a custom number format, however if I change the "=NO" to "=0" the formula still doesn't work!
 
Upvote 0
Then the cells don't have 0 in them. Are they blank?
 
Upvote 0
They are blank until I complete that weeks results. Once I have completed that weeks results then these will be full of 1's or 0's.

Currently I have filled one week and have 3 0's, but my formula doesn't recognise this and returns a count of 0
 
Upvote 0
I've just looked closer at your formula and it doesn't do what you think. The ranges in a COUNTIFS formula must all be the same size and shape. Since yours aren't, the COUNTIFS part returns a #VALUE error, which your IFERROR turns into 0. You'd need a SUMPRODUCT formula - and you really need to avoid using entire column references with this construction, so use something like:

=IFERROR(SUMPRODUCT(('Scores - 2019'!$A$1:$A$1000=R11)*('Scores - 2019'!$P$1:$T$1000=0)),0)
 
Upvote 0
Thanks Rory.

This works!! Turns out that I had alot more 0's hidden than I thought so just need to fix this for it to make sense!

Thanks for your help
 
Upvote 0
Hi all,

Unfortunately this still isn't working and I am determined to sort it (with help hopefully!)

To try to simplify what I am trying to do, I am trying to count the number of 0's in columns D-T if the cell in column A is equal to cell U4 (for example)

I am struggling to put a detailed table into my feeds so I cannot make it clearer than the tables in the trail.

Can anybody help?

The formula that I was supplied with previously returned a number of over 200 when it should be a maximum of 3 with the data entered currently.

I can supply more details if required.

Thanks

Chris
 
Upvote 0

Forum statistics

Threads
1,216,746
Messages
6,132,475
Members
449,729
Latest member
davelevnt

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