Countifs with Mutiple Criteria

adrienne0914

Board Regular
Joined
Mar 22, 2018
Messages
73
Office Version
  1. 365
Platform
  1. Windows
This seems like it would be a simple formula but I keep getting a #Value error when I try it. Trying to get a count based on criteria in Column A in addition to Row 1:

DATA:
[TABLE="width: 500"]
<tbody>[TR]
[TD]LOCATION[/TD]
[TD]P01_2018[/TD]
[TD]P02_2018[/TD]
[TD]P03_2018[/TD]
[TD]P04_2018[/TD]
[TD]P05_2016[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD]USATL[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD]USBAL[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD]NO[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD]USLAX[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD]USNYC[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]


SUMMARY:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]P01_2018[/TD]
[TD]P02_2018[/TD]
[TD]P03_2018[/TD]
[TD]P04_2018[/TD]
[TD]P05_2016[/TD]
[/TR]
[TR]
[TD]LANES[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD]CAT 1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]

I want the first line of the summary to count all of the 1s from each column. I want the second line to only count the 1's if Column A does not equal no AND heading matches. Expect results in summary above. I know I could do a pivot table to get a summary, but I have a monthly report that will be pulling this and data from others into one report. So a pivot table is not possible.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi,

Will this work for you?


Book1
ABCDEF
1DATA:
2LOCATIONP01_2018P02_2018P03_2018P04_2018P05_2016
3NO11111
4USATL00010
5NO00000
6NO10010
7USBAL11111
8NO11111
9USLAX01110
10USNYC10011
11
12SUMMARY:
13P01_2018P02_2018P03_2018P04_2018P05_2016
14LANES54474
15CAT 122242
Sheet35
Cell Formulas
RangeFormula
B14=SUMPRODUCT(($B2:$F2=B13)*($B3:$F10=1))
B15=SUMPRODUCT(($B2:$F2=B13)*($B3:$F10=1)*($A3:$A10<>"No"))


Formulas copied across.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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