Forum Discussion

RogerShack's avatar
RogerShack
Copper Contributor
Sep 26, 2022
Solved

countif additons across multiple rows

looking for a more efficient method to calculate training compliance for a particualr city branch:

I can limt to a particular city using

COUNTIF(C:C,"Canberra")

and then count the 'yes' returns for a particualr column with

COUNTIFS(C:C,"Canberra,D:D,"yes")

but I want to count all the 'yes' responses across all criteria for a given value, ie count all the 'yes' responses for Canberra.

COUNTIFS(C:C"Canberra,D:G,"yes") returns an invalid response (VALUE!) as the range size doesnt match, though I dont want to have to list out for every column as the real sheet has 20 training columns, ie:

COUNTIFS(C:C,"Canberra,D:D,"yes")+COUNTIFS(C:C,"Canberra,E:E,"yes")+COUNTIFS(C:C,"Canberra,F:F,"yes")... etc having to repeat for each additional column.

Is there a method to shorten this query?

 

NameIDCityWHS?Security?Equity?Payroll?
A123Canberrayyyy
B234Brisbaneyyyn
C345Sydneyynyy
D456Canberranyny
E567Canberraynyy
F678Sydneyynyy
G789Brisbanenyyy

 

Any help greatly apprecaited.

 

Cheers

 

Shacks

  • You could try:
    =SUM((C:C="Canberra")*(D:G="y"))

    If you don't have dynamic array excel version:
    =SUMPRODUCT((C:C="Canberra")*(D:G="y"))

2 Replies

  • JMB17's avatar
    JMB17
    Bronze Contributor
    You could try:
    =SUM((C:C="Canberra")*(D:G="y"))

    If you don't have dynamic array excel version:
    =SUMPRODUCT((C:C="Canberra")*(D:G="y"))
    • RogerShack's avatar
      RogerShack
      Copper Contributor
      thanks JMB17 - option 2 worked perfectly. I had tried SUM but must not have the higher spec version of excel.

      cheers

Resources