You are here:

# Excel/number of unique names with nonzero values

Question

count uniques
I need to know a formula that will count the number of UNIQUE codes in column A that are associated with any (not each) non-zero value in column B, then repeat and count the same for each column to the right (C, D, etc.). Report the tallies in a row at the bottom of the table.  What formulas would determine this efficiently?  See attached image.

image
Assuming that data, then this answer:

=COUNT(1/FREQUENCY(IF(\$A\$1:\$A\$17=\$J2,IF(B\$1:B\$17<>"",MATCH(B\$1:B\$17,B\$1:B\$17,0))),ROW(B\$1:B\$17)-ROW(A1)+1))

That is an array formula, confirm it in cell K2 by pressing CTRL-SHIFT-to activate the array. You will see curly braces { } appear around the formula to indicate an active array.  Then copy it down and across the table.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Jerry Beaucaire

##### Expertise

Excel Formulas, macros, automation. Microsoft Excel MVP - 2010. Code site with free code snippets and techniques: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files

##### Experience

Microsoft Excel MVP - 2010. I have my own extensive Excel help/code site: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files ===================== I have been offering free assistance as an Excel aid on many web sites for many years: (http://www.excelforum.com - JBeaucaire) ======== (http://www.askmehelpdesk.com/spreadsheets - JBeaucaire) ======= (http://www.mrexcel.com/forum - jbeaucaire)

Education/Credentials
Bachelor's Degree from Azusa Pacific University in Mathematics and Music Composition

Awards and Honors
Microsoft Excel MVP 2010