Subtotal in new column

  • Thread starter Thread starter Pete Provencher
  • Start date Start date
P

Pete Provencher

Using Excel 2000:

I know that you can use subtotal from the main menu but what I would like it
to do is put the subtotal number in a new column. What I have is a lot of
records with a company name as a field.. I would like it to count the
duplicate company names and on the first row of a particular company to put
the total times the compay name appears in a new column.

For example:

Company name Count

A 2
A
B 1
C 3
C
C
.......and so forth


Pete provencher
 
Pete

assuming the data is in Column A and there is a header in Cell A1, put this
formula in a cell in Row 2

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

and drag down.

Regards

Trevor
 
Hi Pete,
Since you asked for a total you might want to modify
your request and Trevor's suggestion from

Company, Count, B1: Count
A 2 B2: =IF(A1=A2,"",COUNTIF(A:A,A2))
A B3: =IF(A2=A3,"",COUNTIF(A:A,A3))
B 1 B4: =IF(A3=A4,"",COUNTIF(A:A,A4))
C 3 B5: =IF(A4=A5,"",COUNTIF(A:A,A5))
C B6: =IF(A5=A6,"",COUNTIF(A:A,A6))
C B7: =IF(A6=A7,"",COUNTIF(A:A,A7))
6 B8: =SUM(OFFSET(B1,1,0):OFFSET(B8,-1,0))

To a solution that subtracts one from the counts so the total is the
number of duplicate.

Company, count, B1: Count
A 1 B2: =IF(A1=A2,"",COUNTIF(A:A,A2)-1)
A B3: =IF(A2=A3,"",COUNTIF(A:A,A3)-1)
B 0 B4: =IF(A3=A4,"",COUNTIF(A:A,A4)-1)
C 2 B5: =IF(A4=A5,"",COUNTIF(A:A,A5)-1)
C B6: =IF(A5=A6,"",COUNTIF(A:A,A6)-1)
C B7: =IF(A6=A7,"",COUNTIF(A:A,A7)-1)
3 B8: =SUM(OFFSET(B1,1,0):OFFSET(B8,-1,0))


Trevor Shuttleworth said:
Pete

assuming the data is in Column A and there is a header in Cell A1, put this
formula in a cell in Row 2 [i.e. cell B2]

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

and drag down [with the fill handle].

Regards

Trevor


Pete Provencher said:
Using Excel 2000:

I know that you can use subtotal from the main menu but what I would like it
to do is put the subtotal number in a new column. What I have is a lot of
records with a company name as a field.. I would like it to count the
duplicate company names and on the first row of a particular company to put
the total times the compay name appears in a new column.

For example:

Company name Count

A 2
A
B 1
C 3
C
C
......and so forth


Pete provencher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top