COUNTIFS alternative

kalmar27615

New Member
Joined
May 12, 2014
Messages
7
Hello everyone, I have the following issue I'm hoping you can help me with:

I am trying to count the number of occurrences with 2 criteria: =COUNTIFS(B:B,"Birmingham",C:C,"PASSED")

[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]AL001[/TD]
[TD]Birmingham[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL001[/TD]
[TD]CV[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL001[/TD]
[TD]PHY[/TD]
[TD]PASSED[/TD]
[/TR]
[TR]
[TD]AL001[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL001[/TD]
[TD]Vendor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL002[/TD]
[TD]Birmingham[/TD]
[TD]PASSED[/TD]
[/TR]
[TR]
[TD]AL002[/TD]
[TD]PHY[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL002[/TD]
[TD]Vendor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL003[/TD]
[TD]Birmingham[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AL003[/TD]
[TD]DA[/TD]
[TD]PASSED[/TD]
[/TR]
</tbody>[/TABLE]

The location of the "PASSED" entry is dynamic and is not always directly across from "Birmingham" which is why I am not getting the correct results. Is there a solution to this? Thank you all in advance!
 
Please try to be specific with your requirements. It will make this move much more smoothly. Try this version:


Excel 2012
ABCDEF
1
2CivilAL001Birmingham4
3CivilAL001CV
4CivilAL001PHYPASSEDBirmingham
5CivilAL001No
6CivilAL001Vendor
7CivilAL002BirminghamPASSED
8CivilAL002PHY
9CivilAL002Vendor
10CivilAL003Birmingham
11CivilAL003DAPASSED
12ElecAL003Birmingham
13ElecAL003DA
14ElecAL003DAPASSED
Sheet1
Cell Formulas
RangeFormula
F2{=SUM(IF(FREQUENCY(IF(C2:C14=E4,ROW(C2:C14)),IF((A1:A15<>A2:A16)+(B1:B15<>B2:B16),ROW(B1:B15)))*FREQUENCY(IF(D2:D14="PASSED",ROW(C2:C14)),IF((A1:A15<>A2:A16)+(B1:B15<>B2:B16),ROW(B1:B15))),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.


This version will separate the list into ranges, each range demarked by every time column A or B changes. It will then add 1 every time there is at least 1 Birmingham in that range in column C, and at least 1 PASSED in that range in column D.
 
Upvote 0

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,)

Forum statistics

Threads
1,223,358
Messages
6,171,624
Members
452,412
Latest member
thomasleysen531

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