ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count occurences and return total (https://www.excelbanter.com/excel-worksheet-functions/162894-count-occurences-return-total.html)

Daniel A.

Count occurences and return total
 
HELP! I know someone here can help me! I want to count the number of times
a specific ID number occurs in a column, and return the total count in the
cell adjacent to each occurrence of that number:

ID # Combined Count
343 1
654 3
654 3
654 3
109 2
109 2
433 1

If anyone can advise, I would greatly appreciate it! THANKS!@

Daniel A.[_2_]

Count occurences and return total
 
NEVER MIND! I figured it out myself (after MUCH trial and error). Here it is:

=COUNTIF(A:A,A2)

Thanks anyway!

"Daniel A." wrote:

HELP! I know someone here can help me! I want to count the number of times
a specific ID number occurs in a column, and return the total count in the
cell adjacent to each occurrence of that number:

ID # Combined Count
343 1
654 3
654 3
654 3
109 2
109 2
433 1

If anyone can advise, I would greatly appreciate it! THANKS!@


T. Valko

Count occurences and return total
 
Try one of these:

With ID #'s starting in cell A2, enter this formula in cell B2 and copy down
as needed:

=COUNTIF(A:A,A2)

If the ID #'s are grouped together as in your sample then this is a little
bit better. A1 and B1 are column headers.

Entered in B2 and copied down as needed:

=IF(A2=A1,B1,COUNTIF(A:A,A2))

Using this formula saves from doing a count on every entry and just does a
count on each distinct entry.

--
Biff
Microsoft Excel MVP


"Daniel A." <Daniel wrote in message
...
HELP! I know someone here can help me! I want to count the number of
times
a specific ID number occurs in a column, and return the total count in the
cell adjacent to each occurrence of that number:

ID # Combined Count
343 1
654 3
654 3
654 3
109 2
109 2
433 1

If anyone can advise, I would greatly appreciate it! THANKS!@





All times are GMT +1. The time now is 09:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com