Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Help with counting the number of destinct items in a column

This is my situation, I have vendor names in a column, say A for this
example, and there are 5 vendor name in the list, from row1 to row5. In row
6, I want to enter the number of destinct vendor name in row6. See below for
example.
I don't know if there is a function for this in excel. I would also like
to do this in code especially, because it will make things much easier. Any
ideas or help will be grately appriciated. Thanks.

A
1 TTMI
2 VERIZON
3 ZAYO
4 TTMI
5 ZAYO
---------------
6 3 VENDORS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Help with counting the number of destinct items in a column

'Formula
=SUMPRODUCT((A1:A5<"")/COUNTIF(A1:A5,A1:A5&""))

'The same in VBA
MsgBox Evaluate("=SUMPRODUCT((A1:A5<"""")/COUNTIF(A1:A5,A1:A5&""""))")

If this post helps click Yes
---------------
Jacob Skaria


"Ayo" wrote:

This is my situation, I have vendor names in a column, say A for this
example, and there are 5 vendor name in the list, from row1 to row5. In row
6, I want to enter the number of destinct vendor name in row6. See below for
example.
I don't know if there is a function for this in excel. I would also like
to do this in code especially, because it will make things much easier. Any
ideas or help will be grately appriciated. Thanks.

A
1 TTMI
2 VERIZON
3 ZAYO
4 TTMI
5 ZAYO
---------------
6 3 VENDORS

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Help with counting the number of destinct items in a column

Thanks Jacob. Works great.

"Jacob Skaria" wrote:

'Formula
=SUMPRODUCT((A1:A5<"")/COUNTIF(A1:A5,A1:A5&""))

'The same in VBA
MsgBox Evaluate("=SUMPRODUCT((A1:A5<"""")/COUNTIF(A1:A5,A1:A5&""""))")

If this post helps click Yes
---------------
Jacob Skaria


"Ayo" wrote:

This is my situation, I have vendor names in a column, say A for this
example, and there are 5 vendor name in the list, from row1 to row5. In row
6, I want to enter the number of destinct vendor name in row6. See below for
example.
I don't know if there is a function for this in excel. I would also like
to do this in code especially, because it will make things much easier. Any
ideas or help will be grately appriciated. Thanks.

A
1 TTMI
2 VERIZON
3 ZAYO
4 TTMI
5 ZAYO
---------------
6 3 VENDORS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting items in one column based on criteria in another column luttona Excel Worksheet Functions 3 June 13th 08 06:00 PM
Counting number of text items in list Tanya Excel Discussion (Misc queries) 0 November 29th 06 10:20 PM
Counting number of text items in list Becky Excel Discussion (Misc queries) 0 November 29th 06 09:56 PM
Counting number of items being added in a formula Lambtwo Excel Discussion (Misc queries) 14 November 3rd 05 05:19 PM
counting number of particular items in a list vikkam Excel Discussion (Misc queries) 8 July 5th 05 08:35 AM


All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"