Count If with multiple criteria and unique values

dixon1983

Board Regular
Joined
Apr 23, 2005
Messages
175
Hi,
I dont know if this is possible or not but thought I'd ask anyway.

I have a sheet of data and want to run a count on the values in Column A with the following criteria:

- If the value in column B is repeated then the value in column A can only be counted once...
- Column C must equal 'M'.


Example:
A.....B.....C
1.....42....M
1.....42....M
2.....41....A
2.....41....M
1.....56....M


In this example 1 would be counted 2 times, and 2 would be counted once.

I have about 15 sheets of data like this and would like a master sheet to look into each sheet and give me a count of each so id prefer to not use the advanced filter => unique variables option if possible.

Any help would be greatly appreciated.

Dixon.
 
Hi - I tried figuring my problem, very similar to this thread, on my own but have been unsuccessful. Hoping someone can help out.

I am trying to check for country in Column A and get count of values in column B after removing possible "#N/A" in column B. I also, need final count from column B that excludes any repeats. For data below, my final count from column B for each unique country in column A should be just 1 after removing #N/A and duplicates from column B

Asia
0582.HK
Australia
ARWDA.AX
Australia
ARWDA.AX
Australia
ARWDA.AX
Europe
#N/A
Europe
#N/A
Europe
#N/A
Europe
CFTM.PA
Europe
CFTM.PA

<tbody>
</tbody>

With #N/A's in the relevant range...

X
Y
X
Unique Count
Asia
0582.HK
Asia
1
Australia
ARWDA.AX
Australia
1
Australia
ARWDA.AX
Europe
1
Australia
ARWDA.AX
Europe
#N/A
Europe
#N/A
Europe
#N/A
Europe
CFTM.PA
Europe
CFTM.PA

<tbody>
</tbody>

E2, control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$2:$A$10=$D2,
  MATCH(IF(ISNA($B$2:$B$10),"#",$B$2:$B$10),
  IF(ISNA($B$2:$B$10),"#",$B$2:$B$10),0)),ROW($B$2:$B$10)-ROW($B$2)+1),1))-
  (SUM(IF($A$2:$A$10=$D2,IF(ISNA($B$2:$B$10),1)))>0)

By the way, are #N/A's in B2:B10 caused by a formula? If so, care to post that formula?
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi all, bumping an old thread.

Here is my table that i am struggling with:

Project
ForecastedItem
A
Y1
AY2
AY3
BN1
CY1
DN1
DN2
EY1

<tbody>
</tbody>


I have figured out how to count the unique projects in col A (5 in this case), i am now trying to count the unique projects that were forecasted (should be 3). I am struggling with the If(frequency when there is another embedded If statement.

thanks in advance!
 
Upvote 0
Hi all, bumping an old thread.

Here is my table that i am struggling with:

Project

Forecasted
Item
A
Y
1
A
Y
2
A
Y
3
B
N
1
C
Y
1
D
N
1
D
N
2
E
Y
1

<TBODY>
</TBODY>


I have figured out how to count the unique projects in col A (5 in this case), i am now trying to count the unique projects that were forecasted (should be 3). I am struggling with the If(frequency when there is another embedded If statement.

thanks in advance!

Control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$2:$A$9<>"",IF($B$2:$B$9="Y",
  MATCH("~"&$A$2:$A$9,$A$2:$A$9&"",0))),ROW($A$2:$A$9)-ROW($A$2)+1),1))
 
Upvote 0
Hello All! This is my first post to Mr. Excel, so I'm kind of excited... but confused. I've tried implementing this Sum, If, Frequency formula to my spreadsheet, but have had no luck.

AB
EmployeeIDDept
1727054971000
1727054971000
1727176934000
1727176934000
1727248081100
1727377041000
1727440091000

<colgroup><col><col></colgroup><tbody>
</tbody>

I need to figure out how many unique Employee ID's are in Department 1000. I may just be having a two day brain fog, but I can't figure out how to do this... Any help is greatly appreciated!
 
Upvote 0
Hello All! This is my first post to Mr. Excel, so I'm kind of excited... but confused. I've tried implementing this Sum, If, Frequency formula to my spreadsheet, but have had no luck.

A
B
EmployeeID
Dept
172705497
1000
172705497
1000
172717693
4000
172717693
4000
172724808
1100
172737704
1000
172744009
1000

<TBODY>
</TBODY>

I need to figure out how many unique Employee ID's are in Department 1000. I may just be having a two day brain fog, but I can't figure out how to do this... Any help is greatly appreciated!

E2: 1000 (a department of interest)

F2, control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$2:$A$8<>"",IF($B$2:$B$8=$E2,
  MATCH("~"&$A$2:$A$8,$A$2:$A$8&"",0))),ROW($A$2:$A$8)-ROW($A$2)+1),1))
 
Upvote 0
Hi Aladin!

Thank you so much for all of your help. I was converting your formula range to include the entire columns, instead A2:A8. Is that possible, or is that the reason I'm getting the error?
 
Upvote 0

Forum statistics

Threads
1,216,503
Messages
6,131,020
Members
449,615
Latest member
Nic0la

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