Counting Only Once If The Entry Appears Multiple Times<p align=left><font face=Arial size=2>Hi,</font></p> <p align=left> </p> <p align=left>Here's the situation.  I have a column in an Excel 2003 document with multiple number entries.  Each number entry appears more than once.  I want to count the number of unique entries in this column, meaning that if an entry appears more than once in the column, I only want to count it once.  Does anyone know how to do this because I really have no idea.</p> <p align=left> </p> <p align=left>Thanks.</p>© 2009 Microsoft Corporation. All rights reserved.Fri, 08 May 2009 18:02:33 Zaa36f0b9-1835-4af1-8bd2-e7850df668c1http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#aa36f0b9-1835-4af1-8bd2-e7850df668c1http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#aa36f0b9-1835-4af1-8bd2-e7850df668c1Eazy-Dhttp://social.msdn.microsoft.com/Profile/en-US/?user=Eazy-DCounting Only Once If The Entry Appears Multiple Times<p align=left><font face=Arial size=2>Hi,</font></p> <p align=left> </p> <p align=left>Here's the situation.  I have a column in an Excel 2003 document with multiple number entries.  Each number entry appears more than once.  I want to count the number of unique entries in this column, meaning that if an entry appears more than once in the column, I only want to count it once.  Does anyone know how to do this because I really have no idea.</p> <p align=left> </p> <p align=left>Thanks.</p>Tue, 17 Jun 2008 13:15:08 Z2008-06-17T13:15:08Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#c2896a5d-7278-4e6b-b215-af2886302eb9http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#c2896a5d-7278-4e6b-b215-af2886302eb9Andy Popehttp://social.msdn.microsoft.com/Profile/en-US/?user=Andy%20PopeCounting Only Once If The Entry Appears Multiple TimesHi,<br><br>Assuming values in column A enter this in column B and copy down.<br><br>=COUNTIF($A$2:A2,A2)=1<br><br>This will give you a  column of TRUE / FALSE, where the count of TRUE's is the unique count.<br>Tue, 17 Jun 2008 15:39:26 Z2008-06-17T15:39:26Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#cb46276d-bf1c-4ccd-97da-c74742b1d671http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#cb46276d-bf1c-4ccd-97da-c74742b1d671suznalhttp://social.msdn.microsoft.com/Profile/en-US/?user=suznalCounting Only Once If The Entry Appears Multiple Times<p align=left><font face=Arial>There are several ways to accomplish this. You could use a pivot table...</font></p> <p align=left>You could also use a formula on the worksheet...</p> <p align=left> </p> <p align=left><font face="Times New Roman">Formula: =SUM(IF(FREQUENCY(IF(LEN(A1:A10)&gt;0,MATCH(A1:A10,A1:A10,0),&quot;&quot;),IF(LEN(A1:A10)&gt;0,MATCH(A1:A10,A1:A10,0),&quot;&quot;))&gt;0,1)) </font></p> <p align=left><font face="Times New Roman"></font> </p> <p><font face="Times New Roman">Formula: =SUMPRODUCT((A1:A10&lt;&gt;&quot;&quot;)/(COUNTIF(A1:A10,A1:A10&amp;&quot;&quot;))) </font></p> <p><font face="Times New Roman">Formula: =SUMPRODUCT((A1:A10&lt;&gt;&quot;&quot;)/(COUNTIF(A1:A10,A1:A10)+(A1:A10=&quot;&quot;)))</font> </p> <p> </p> <p align=left>or with VBA...</p> <p align=left> </p> <p align=left>your list range = where your list is located</p> <p align=left>destination range = the below will copy the unique entries from the list to a new (and could be temporary) location</p> <p align=left>(I would have the destination be a named range - lets call it &quot;dest&quot;)</p> <p align=left> </p> <p align=left> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div>Range(&quot;your list range&quot;).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _<br>        &quot;dest&quot;), Unique:=True <p align=left> </p></div></div> <p align=left> </p> <p></p> <p> </p> <p align=left>Then use the following to get a count of the items in the new list...</p> <p align=left> </p> <p align=left> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div>Range(&quot;wherever you want it&quot;).FormulaR1C1 = &quot;=SUM(dest)&quot; <p align=left> </p></div></div> <p align=left> </p> <p></p> <p align=left> </p> <p align=left> </p> <p align=left> </p> <p align=left><font color="#ff0000">sorry Andy, I got a phone call after I started typing, didn't see that you replied when i got off.</font></p>Tue, 17 Jun 2008 16:07:31 Z2008-06-17T16:07:31Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#a90c7bb2-7a04-4caf-916b-8bd1021255fchttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#a90c7bb2-7a04-4caf-916b-8bd1021255fcAndy Popehttp://social.msdn.microsoft.com/Profile/en-US/?user=Andy%20PopeCounting Only Once If The Entry Appears Multiple TimesNo need for apology.<br><br>There is always more than 1 way to skin this cat called Excel <img height=19 alt=Smile src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif" width=19><br>Tue, 17 Jun 2008 18:40:17 Z2008-06-17T18:40:17Zhttp://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#f4d67646-12c2-4053-9d31-0197591f07b3http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/aa36f0b9-1835-4af1-8bd2-e7850df668c1#f4d67646-12c2-4053-9d31-0197591f07b3Eazy-Dhttp://social.msdn.microsoft.com/Profile/en-US/?user=Eazy-DCounting Only Once If The Entry Appears Multiple TimesThanks <p align=left><font face=Arial size=2></font> </p>Wed, 18 Jun 2008 20:24:51 Z2008-06-18T20:24:51Z