#### Counting unique cells (with text) in a filtered list

```Hi
Is there a simple way to count unique text values in the 'header" of a

Example
A  Home
B  Car
B  Home
C  Home
C  Home
D  Car

If filtered on Home in the second column, should show 3 (ie A,B and
C).

```
 1
Manosh
3/25/2010 5:43:43 PM
excel 39879 articles. 2 followers.

5 Replies
3022 Views

Similar Articles

[PageSpeed] 22

```Try this array formula** :

=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2:A7,ROW(A2:A7)-ROW(A2),0,1)),MATCH(A2:A7,A2:A7,0)),ROW(A2:A7)-ROW(A2)+1)>0,1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP

"Manosh" <manoshde@gmail.com> wrote in message
> Hi
> Is there a simple way to count unique text values in the 'header" of a
> column where the adjoining column has had the filter switched on?
>
> Example
> A  Home
> B  Car
> B  Home
> C  Home
> C  Home
> D  Car
>
> If filtered on Home in the second column, should show 3 (ie A,B and
> C).
>

```
 0
T
3/26/2010 1:06:16 AM
```On Mar 26, 5:06=A0am, "T. Valko" <biffinp...@comcast.net> wrote:
> Try this array formula** :
>
> =3DSUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2:A7,ROW(A2:A7)-ROW(A2),0,1)),M=
>
> ** array formulas need to be entered using the key combination of
> CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SH=
IFT
> key then hit ENTER.
>
> --
> Biff
> Microsoft Excel MVP
>
> "Manosh" <manos...@gmail.com> wrote in message
>
>
>
>
> > Hi
> > Is there a simple way to count unique text values in the 'header" of a
> > column where the adjoining column has had the filter switched on?
>
> > Example
> > A =A0Home
> > B =A0Car
> > B =A0Hoame
> > C =A0Home
> > C =A0Home
> > D =A0Car
>
> > If filtered on Home in the second column, should show 3 (ie A,B and
> > C).
>
> > Thanks in advance- Hide quoted text -
>
> - Show quoted text -

Thanks Biff
I am not getting this to work when i copy paste it into my location
and adjust the ColRow reference and press control shift enter. It
gives me a Name error.
Where should this be - ie preceding the information of the 1st or 2nd
column? Also my actual data starts in line 5 with the filter in 4
whilst these subtotals are in line 1.
```
 0
Manosh
3/26/2010 1:45:34 AM
```>my actual data starts in line 5 with the filter in
>4 whilst these subtotals are in line 1

Here's a small sample file that demonstrates this.

Count uniques filter.xls  14kb

--
Biff
Microsoft Excel MVP

"Manosh" <manoshde@gmail.com> wrote in message
On Mar 26, 5:06 am, "T. Valko" <biffinp...@comcast.net> wrote:
> Try this array formula** :
>
> =SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2:A7,ROW(A2:A7)-ROW(A2),0,1)),MATCH�(A2:A7,A2:A7,0)),ROW(A2:A7)-ROW(A2)+1)>0,1))
>
> ** array formulas need to be entered using the key combination of
> CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
> SHIFT
> key then hit ENTER.
>
> --
> Biff
> Microsoft Excel MVP
>
> "Manosh" <manos...@gmail.com> wrote in message
>
>
>
>
> > Hi
> > Is there a simple way to count unique text values in the 'header" of a
> > column where the adjoining column has had the filter switched on?
>
> > Example
> > A Home
> > B Car
> > B Hoame
> > C Home
> > C Home
> > D Car
>
> > If filtered on Home in the second column, should show 3 (ie A,B and
> > C).
>
> > Thanks in advance- Hide quoted text -
>
> - Show quoted text -

Thanks Biff
I am not getting this to work when i copy paste it into my location
and adjust the ColRow reference and press control shift enter. It
gives me a Name error.
Where should this be - ie preceding the information of the 1st or 2nd
column? Also my actual data starts in line 5 with the filter in 4
whilst these subtotals are in line 1.

```
 0
T
3/26/2010 2:28:50 AM
```On 26 Mar, 06:28, "T. Valko" <biffinp...@comcast.net> wrote:
> >my actual data starts in line 5 with the filter in
> >4 whilst these subtotals are in line 1
>
> Here's a small sample file that demonstrates this.
>
> Count uniques filter.xls =A014kb
>
>
> --
> Biff
> Microsoft Excel MVP
>
> "Manosh" <manos...@gmail.com> wrote in message
>
> On Mar 26, 5:06 am, "T. Valko" <biffinp...@comcast.net> wrote:
>
>
>
>
>
> > Try this array formula** :
>
> > =3DSUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2:A7,ROW(A2:A7)-ROW(A2),0,1))=
>
> > ** array formulas need to be entered using the key combination of
> > CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
> > SHIFT
> > key then hit ENTER.
>
> > --
> > Biff
> > Microsoft Excel MVP
>
> > "Manosh" <manos...@gmail.com> wrote in message
>
..
>
> > > Hi
> > > Is there a simple way to count unique text values in the 'header" of =
a
> > > column where the adjoining column has had the filter switched on?
>
> > > Example
> > > A Home
> > > B Car
> > > B Hoame
> > > C Home
> > > C Home
> > > D Car
>
> > > If filtered on Home in the second column, should show 3 (ie A,B and
> > > C).
>
> > > Thanks in advance- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks Biff
> I am not getting this to work when i copy paste it into my location
> and adjust the ColRow reference and press control shift enter. It
> gives me a Name error.
> Where should this be - ie preceding the information of the 1st or 2nd
> column? Also my actual data starts in line 5 with the filter in 4
> whilst these subtotals are in line 1.- Hide quoted text -
>
> - Show quoted text -

Great - it works! thanks for the xls
```
 0
Manosh
3/26/2010 10:22:04 AM
```You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP

"Manosh" <manoshde@gmail.com> wrote in message
On 26 Mar, 06:28, "T. Valko" <biffinp...@comcast.net> wrote:
> >my actual data starts in line 5 with the filter in
> >4 whilst these subtotals are in line 1
>
> Here's a small sample file that demonstrates this.
>
> Count uniques filter.xls 14kb
>
>
> --
> Biff
> Microsoft Excel MVP
>
> "Manosh" <manos...@gmail.com> wrote in message
>
> On Mar 26, 5:06 am, "T. Valko" <biffinp...@comcast.net> wrote:
>
>
>
>
>
> > Try this array formula** :
>
> > =SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2:A7,ROW(A2:A7)-ROW(A2),0,1)),MATCH��(A2:A7,A2:A7,0)),ROW(A2:A7)-ROW(A2)+1)>0,1))
>
> > ** array formulas need to be entered using the key combination of
> > CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
> > SHIFT
> > key then hit ENTER.
>
> > --
> > Biff
> > Microsoft Excel MVP
>
> > "Manosh" <manos...@gmail.com> wrote in message
>
>
> > > Hi
> > > Is there a simple way to count unique text values in the 'header" of a
> > > column where the adjoining column has had the filter switched on?
>
> > > Example
> > > A Home
> > > B Car
> > > B Hoame
> > > C Home
> > > C Home
> > > D Car
>
> > > If filtered on Home in the second column, should show 3 (ie A,B and
> > > C).
>
> > > Thanks in advance- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks Biff
> I am not getting this to work when i copy paste it into my location
> and adjust the ColRow reference and press control shift enter. It
> gives me a Name error.
> Where should this be - ie preceding the information of the 1st or 2nd
> column? Also my actual data starts in line 5 with the filter in 4
> whilst these subtotals are in line 1.- Hide quoted text -
>
> - Show quoted text -

Great - it works! thanks for the xls

```
 0
T
3/26/2010 3:54:12 PM

Similar Artilces:

Excel-how (find/replace) for multifmat cells w/o changing fmat
For a client, i need to be able to find and replace words in cells with 2 formats. But when you replace them,it changes the format of the whole cell, and not just what you changed. Is there any way to work around this without changing the format after all of the find and replaces? Saved from a previous post, but this one has some wordwrap problems fixed: I think you'd have to keep track of each character's font attributes. This works very slowly, but works: Option Explicit Option Compare Text Type myCharacter myChar As String myLen As Long myName As String myFo...

Pivot table and counting.
I have a pivot table that gives me the number of rides done by a van. I can have the pivot table return the number of rides, but what I need is the number vans that participated for a certain day. Example, it is possible to have 27 trips done by 18 vans, how can I count the number of vans and not addup the van number? Any help appreciated. Thank you, Joe Hi Joe We need a bit more information on how your source data table is set up. What information do you have in each column? -- Regards Roger Govier sacredarms <sacredarms@discussions.microsoft.com> wrote: > I have a pi...

Cell formating in Excel?
Is there a way to have a scroll bar in a single cell? No. -- Best Regards, Luke M "pmarina" <pmarina@discussions.microsoft.com> wrote in message news:5D25B665-B7B8-477D-AAF8-80A347FFA0DD@microsoft.com... > Is there a way to have a scroll bar in a single cell? ...

Cycle Counting
Hello, I am looking for ideas on how to cycle count serial number tracked items without increasing workload. Our serialized items are barcoded but the problem is the are situated on the pallet incorrectly and the pallet is placed on a third level of a racking system. If we could just cycle count based on item count and not include the serial number it would make it easy. Is this possible in Great Plains. We are running Great Plains 8.0. Any suggestions are greatly aprreciated. Thank You, Brian Morris Database Administrator ...

Import text file from MS Word into MS Publisher.
I have created a text file in Word and a photo file in Publisher and would like to merge the two. When I imported Word, it seemed to be totally separate from the Publisher document - 7 pages of Word and 8 pages of photos. I want the Word pages to precede the Publisher pages. How is this done? >-----Original Message----- >I have created a text file in Word and a photo file in Publisher and would >like to merge the two. When I imported Word, it seemed to be totally >separate from the Publisher document - 7 pages of Word and 8 pages of photos. > >I want the Word pages ...

Set RN = Range(Cells(2, 1), Cells(r, 1)) error
What wrong with this. It create error. How can I improve to get rid the error? Set RN = Range(Cells(2, 1), Cells(r, 1)) Thanks Daniel Hi Daniel, Too much missing information - has r been declared and what data type is it and what value does it have. What property of the range are you trying to store in the variable RN? What type of variable is RN and has it been declared. -- Thanks, Shane Devenshire "Daniel" wrote: > What wrong with this. It create error. How can I improve to get rid the > error? > > Set RN = Range(Cells(2, 1), Cells(r, 1)) > &...

Can I limit a cell to 2 characters?
Is there a way in Excel to limit the number of characters in a cell? Thanks Frank By checking the length of the cell =LEN(A1)=2 in your custom validation. Look for Data Validation on Debra Dalgleish's site. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Frankc" <Frankc@discussions.microsoft.com> wrote in message news:842747F1-1792-4BB5-B3CE-707C7CC5F88F@microsoft.com... > Is there a way in Excel to lim...

configure text box
I recently upgraded to Publisher 2003. I can't find how to configure text boxes to overlap each other and keep the text in the same position. In my old version, there was a "check" box in the format text box to allow for this. I've tried different wrapping options in 2003, but can't figure it out. You never have been able to do this in any version of Publisher. You are dreaming about a Text Box - never existed. You either have to place one Text Frame on the Background (Ctrl+M) or convert one to a graphic. -- "If you don't know where you are going, any road...

To keep in just one cell all values related to a monthly rate
I have to update in a monthly basis a currency rate. I know that there is a function, formula (or something like that) to link a month descripton to a number. e.g. September09 1,325 October09 2,235 November09 1,258 I would like to select correspondent month and the cell be updated with the value. Data Validation dropdown list for choosing the month combined with a lookup table and VLOOKUP function. For help on creating data validation dropdown lists see Debra Dalgleish's site. http://www.contextures.on.ca/xlDataVal01.html For help on VLOOKUP to populat...

How do I count the # of times a value reoccurs and plot it over ti
I wish to plot a number of errors made by each users and compare it over time. I have a column of user ID's and a column of dates. I want the chart to count the number of times each user ID appears and plot against it's corresponding date. However, each time I try to do this, the chart appears wrong. Any ideas? In article <9595B2A1-8282-4AB3-8511-A6776E108164@microsoft.com>, Stephen@discussions.microsoft.com says... > I wish to plot a number of errors made by each users and compare it over > time. I have a column of user ID's and a column of dates. I want t...

format cells #4
hi. how can i set by default the cell formatting to 'general' or 'number' or even 'text'? i mean i dont want excel to correct let's say: 1.5 to 01.may or 9/12 to 09.dec. is this possible? thanks. (i have some programs which export data to excel and instead of numbers in excel appear dates and i can't set the cell format before the data is exported) -- notrace2004 ------------------------------------------------------------------------ notrace2004's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=34817 View this thread: http://www....

I have created a chart in Excel that tracks one of the stock indexes. I have been able to point arrows to specific days and add text so I know what was the reason the stock index was up or down on that day. However, as my chart expands the arrows and text are no longer associated with those day I initially intended it for. Is there any way in Excel to associate text with specific day and have it attached so that if the chart grows or shrinks it will always be associated with that particular day. Thanks Hi Roy, The trick is to group the graphic element and the chart. When adding a graph...

change highlight color on active cells
How do I change the active highlight color of an active cell. Louis Only though VBA. Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Static OldCell As Range If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone End If Target.Interior.ColorIndex = 6 'yellow Set OldCell = Target End Sub This is sheet event code. Right-click on the sheet tab and "View Code". Copy and paste into that module. Chip Pearson has a great add-in named Rowliner.xla that will make the highlighting available for all sheets and workbooks. The code above w...

Count
Hi, I would like to know how which formula I should use to count some codes & to ignore the duplicated codes, for example in column A: Code 1234 4321 4321 1234 1234 3214 Now, I want Excel to count & the result is 3 which are: 1234-4321-3214 Yes I can use PivotTable, but I would like to use a formula because I have to deal with this every day. I appreciate your support. -- MFS22 COUNTIF will do it. =COUNTIF(Rng,Rng), where the criterion is the same as the range: e.g =COUNTIF(A3:A8,A3:A8) HTH Peter "MFS" wrote: > Hi, > I wo...

Simple...Update Text Box in Chart
Hello, I have a chart in an MS Excel worksheet and I would like to change the value/caption of a textbox( Text Box 20). I have only been able to change the title of the chart with the following: With MyChart.Workbooks(1).Worksheets("Chart").ChartObjects(1).Chart .HasTitle = True .ChartTitle.Text = "Summary of Report" & date() 'Add Today's Date End With Do I have to reference the chart or do I have to reference the textbox itself? Hi, If the shape is actual embedded in the chart object then something like, ActiveChart.Shapes(&quo...

Formatting cells in Excel with Ascending/Descending order
I am trying to insert a drop down asceding/descending arrow in the cell of the excel document. When you click on the arrow which is a small box on the right side of the cell, it will organize all figures/data in that column and you can choose between ascending/descending, or how you want to organize it. Thank you -- Andrew ...

Line count
I am working with a program called Dictaphone. We use Word 2007 in this program. The line count on Dictaphone and the line count in Word 2007 are different even though the Dictaphone text is retrieved from Word 2007. Why would they be different? What is the difference between virutal line count and physical line count? ...

Text to Columns 06-01-10
Hi. I have a column where I have names and surnames. I want to put name in one column and surname in anoter column. In order to do this, I use Text to Columns, but I have the following issue: if the cell contains for example Juan Pérez, it works ok, but when the cell contains Juan De los Santos, it assumes there are three surnames, and then put me one word in each column. This is the result, with the example mentioned: A B C D Juan Pérez Juan De los Santos How can I indicate that...

count number of characters in rich edit control
How can i count number of characters in rich edit control 2 If u mean controls of type Rich TextBox control, try RichControl1 RC1; CString Mes=RC.GetText(); int n=Mes.GetLength(); "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i count number of characters in rich edit control 2 EM_GETTEXTLENGTHEX, WM_GETTEXTLENGTH, WM_GETTEXT, EM_STREAM* "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i co...

Counting sales
I have two different datasets. Each with a common identifier. I need a formula that will reference the identifiers in both datasets and count the number of sales a particular agent made. Example. look up this identifier in the other dataset and then give me the value that is 2 columns over from the identifier in the second dataset. See if this helps: http://contextures.com/xlFunctions02.html -- Biff Microsoft Excel MVP "Dave" <Dave@discussions.microsoft.com> wrote in message news:E7245B37-033F-400E-9CEE-9822BE7CB0F5@microsoft.com... >I have two...

How to retrieve value from specific cell value?
Does anyone have any suggestions on how to retrieve value from specific cell value with specific worksheet? I would like to create a if-statement within macro, If specific cell within specific worksheet = 1 then process following code End If Does anyone have any suggestions? Thanks in advance for any suggestions Eric hi If Sheets("sheet1").Range("A1") = 1 Then MsgBox "run code" Else MsgBox "skip code" End If regards FSt1 "Eric" wrote: > Does anyone have any suggestions on how to retrieve value from specific cell &...

COUNT ? need formula
Hi, I want to track the results of my teams sales performance. I record if it is a sale, no sale, cancelled etc in column M. I thought I'd be able to use the COUNT function/formula to be able to search for all the SALES in column M and place the result in a cell ( column O )but I can't work it out. Any ideas? Damian Hi! Try this: =COUNTIF(M1:M100,"sale") Biff "Diamond Jones" <kwanzaNOSPAM@optusnet.com.au> wrote in message news:43a0e897\$0\$17704\$afc38c87@news.optusnet.com.au... > Hi, > > I want to track the results of my teams sales perf...

How to size static text box?
I've got a relatively simple dialog that includes some static text along the border containing a mini-help message. On my two systems here with Win2K and WinXP at both 1200x1024 and 1600x1200 resolution the text displays fine. At another location with both WinNT4.0 at 1024x768 and Win2K at 1200x1024 part of the text is cut off because the box is too small for it. It's possible, I think, that the problem isn't the resolution of the displays but the size of the "standard text" font, but I don't want to start changing a dozen different desktop fonts until I find which ...

Pasting text from Word 2008 into dreamweaver
It doesn't work. This is a major problem and jams my workflow. Yes I can drag text from word to DW or I can paste in code view but this kills all formatting. This makes 2008 a definite no no for purchase as far as I am concerned and I am sure many other people.<br> <br> K <kokney@officeformac.com> wrote: > It doesn't work. This is a major problem and jams my workflow. I remember other people posting about this in the group. As I remember it, Office places multiple formats fo the text in the clipboard and it's up to DW to decide which one to take. Apparentl...

Counting Cells with Conditional Formatting
Is there a way to look at a row of data that is either highlighted yellow or red and to count only the data that is highlighted yellow and give me that number? None of my data is numerical....just one letter data, i.e.: "S" or "U" I just want to count how many of the cells are highlighted yellow in a specific row, if that makes more sense. Here's a UDF (Put in a Standard module) and use it in cell A1, like =CountByColor(A8:H8,6) << where 6 (at present) = Yellow = change to =CountByColor(A8:H8,3) to get the reds HTH Function CountByColor(InRa...