count unique values if range meets criteria

alirulez

New Member
Joined
Jul 4, 2015
Messages
35
Hello

Hope you can help me out of this conundrum

I have a list constructed as follows

[TABLE="width: 500"]
<tbody>[TR]
[TD]User ID
[/TD]
[TD]Type[/TD]
[TD]Phone Numbers
[/TD]
[/TR]
[TR]
[TD]2231
[/TD]
[TD]Incoming
[/TD]
[TD]01159796555
[/TD]
[/TR]
[TR]
[TD]2231
[/TD]
[TD]Outgoing
[/TD]
[TD]01159796553
[/TD]
[/TR]
[TR]
[TD]2296
[/TD]
[TD]Local
[/TD]
[TD]01159795983
[/TD]
[/TR]
[TR]
[TD]2231
[/TD]
[TD]Toll
[/TD]
[TD]01159796523
[/TD]
[/TR]
[TR]
[TD]3400
[/TD]
[TD]Outgoing
[/TD]
[TD]01159796123
[/TD]
[/TR]
</tbody>[/TABLE]

Id like a formula which returns the number of unique Phone numbers, if the User ID is 2231, and If the Type is Not Incoming.

Ive tried a number of options with SumProduct and Count Ifs etc, but all have ended in failure

Best
Ali
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Here are some formula ways.
Both are array formulas that must be entered with CTRL-SHIFT-ENTER.

Formula in B11 can only be used if phone numbers are numeric. Formula in B10 will work with either numeric are teat values.
Both of these formulas assume there will be no blanks in the phone number column. If there could be blanks we will need to add another IF statement in the formula.
Excel Workbook
ABC
1User IDTypePhone Numbers
22231Incoming1159796555
32231Outgoing1159796553
42296Local1159795983
52231Toll1159796523
63400Outgoing1159796123
72231Outgoing1159796553
8
9User ID2231
10Count2If Phone # is text
112If Phone # is numeric
Sheet
 
Upvote 0
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]User ID[/TD]
[TD]Type[/TD]
[TD]Phone Numbers[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
2231​
[/TD]
[TD]Incoming[/TD]
[TD]
1159796555​
[/TD]
[TD][/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
2231​
[/TD]
[TD]Outgoing[/TD]
[TD]
1159796553​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
2296​
[/TD]
[TD]Local[/TD]
[TD]
1159795983​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
2231​
[/TD]
[TD]Toll[/TD]
[TD]
1159796523​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
3400​
[/TD]
[TD]Outgoing[/TD]
[TD]
1159796123​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


E2=SUM(IF(FREQUENCY(IF(A2:A6=A2,IF($B$2:$B$6<>B2,C2:C6)),C2:C6),1)) control+shift+enter
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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