Count unique values using Frequency, Match, ISNUMBER, and SEARCH

flower8330

New Member
Joined
May 27, 2015
Messages
2
Hi,
I want to count the unique values in column A. Column B contains various text values. I want to count all unique values of column A that have a column B that contains "2003" within the text value.

Example data:
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[/TR]
[TR]
[TD]Server 1
[/TD]
[TD]Windows 2000
[/TD]
[/TR]
[TR]
[TD]Server 2
[/TD]
[TD]Windows 2003
[/TD]
[/TR]
[TR]
[TD]Server 2
[/TD]
[TD]Windows 2003
[/TD]
[/TR]
[TR]
[TD]Server 3
[/TD]
[TD]Windows 2003 enterprise server
[/TD]
[/TR]
</TBODY>[/TABLE]


I need a formula that will return the value 2 (essentially counting Server 2 and Server 3).


If have the formulas below, but don't know how to combine them.

=SUM(IF(FREQUENCY(MATCH(A1:A4,A1:A4,0),MATCH(A1:A4,A1:A4,0))>0,1))

=ISNUMBER(SEARCH("2003",A:A))


Also, I would like to know if there is a way to allow for the range to be bigger than the data since the number of rows will grow over time.
I tried using a larger end range, but the funtion threw an error.
=SUM(IF(FREQUENCY(MATCH(A1:A4,A1:A10,0),MATCH(A1:A4,A1:A10,0))>0,1))

I'm using Excel 2010 on Win 7
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to Mr Excel

Try

=SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH(2003,B1:B4)),MATCH(A1:A4,A1:A4,0)),ROW(A1:A4)-ROW(A1)+1),1))
Ctrl+Shift+Enter

Hope this helps

M.
 
Last edited:
Upvote 0
Welcome to Mr Excel

Try

=SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH(2003,B1:B4)),MATCH(A1:A4,A1:A4,0)),ROW(A1:A4)-ROW(A1)+1),1))
Ctrl+Shift+Enter

Hope this helps

M.

How can I pick apart this formula to see if it's working correctly?
the formula returns a value of 628, but when i filter the data manually and remove the duplicates I get 536
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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