ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Counting rows??? (https://www.excelbanter.com/excel-discussion-misc-queries/196922-counting-rows.html)

Lockedhart

Counting rows???
 
I have the following in a spreadsheet:

Column A
6650
8334
2331
6650
6650
2331
6650

I want to create a function that will count Column A but do some sort of
incremental counting. This is the result I would like to achieve:

Column A Column B
6650 1
8334 1
2331 1
6650 2
6650 3
2331 2
6650 4

Please help. I have about 25,00o records and I don't want to do this
manually. I've tried =countif and other things. Please advise.

Thanks.

Gary''s Student

Counting rows???
 
In B1, put 1. In B2, enter:

=COUNTIF($A$1:A2,A2) and copy down
--
Gary''s Student - gsnu200796

Lockedhart

Counting rows???
 
WOW!!! That easy, huh? Thank you. It worked.

"Gary''s Student" wrote:

In B1, put 1. In B2, enter:

=COUNTIF($A$1:A2,A2) and copy down
--
Gary''s Student - gsnu200796


Lars-Åke Aspelin[_2_]

Counting rows???
 
On Wed, 30 Jul 2008 09:03:01 -0700, Gary''s Student
wrote:

In B1, put 1. In B2, enter:

=COUNTIF($A$1:A2,A2) and copy down


Or just put

=COUNTIF($A$1:A1,A1)

in B1 and copy down

Lars-Åke


Lockedhart

Counting rows???
 
Okay...need to add to it.

My spreadsheet is grouped by Member ID, is there away to copy the formula
so the range is restricted to that Member? For example,

Column A (Member ID) Column B
123 6650
123 8834
123 2331
123 6650
123 6650

456 8834
456 2231
456 2231
456 8834
456 6650

Any ideas?

Thank you.

"Gary''s Student" wrote:

In B1, put 1. In B2, enter:

=COUNTIF($A$1:A2,A2) and copy down
--
Gary''s Student - gsnu200796


Lars-Åke Aspelin[_2_]

Counting rows???
 
On Wed, 30 Jul 2008 09:21:01 -0700, Lockedhart
wrote:

Okay...need to add to it.

My spreadsheet is grouped by Member ID, is there away to copy the formula
so the range is restricted to that Member? For example,

Column A (Member ID) Column B
123 6650
123 8834
123 2331
123 6650
123 6650

456 8834
456 2231
456 2231
456 8834
456 6650

Any ideas?

Thank you.

"Gary''s Student" wrote:

In B1, put 1. In B2, enter:

=COUNTIF($A$1:A2,A2) and copy down
--
Gary''s Student - gsnu200796


Try this formula in cell C1 and copy down

=IF(A1="","",SUMPRODUCT((A$1:A1=A1)*(B$1:B1=B1)))

Ready for next additional requirement ;-)

Lars-Åke


Lockedhart

Counting rows???
 
Very cute Lars-Ake! No more additions to my problem. This is it.

When you have time can you explain this in 'English'?

Thanks.

"Lars-Ã…ke Aspelin" wrote:

On Wed, 30 Jul 2008 09:21:01 -0700, Lockedhart
wrote:

Okay...need to add to it.

My spreadsheet is grouped by Member ID, is there away to copy the formula
so the range is restricted to that Member? For example,

Column A (Member ID) Column B
123 6650
123 8834
123 2331
123 6650
123 6650

456 8834
456 2231
456 2231
456 8834
456 6650

Any ideas?

Thank you.

"Gary''s Student" wrote:

In B1, put 1. In B2, enter:

=COUNTIF($A$1:A2,A2) and copy down
--
Gary''s Student - gsnu200796


Try this formula in cell C1 and copy down

=IF(A1="","",SUMPRODUCT((A$1:A1=A1)*(B$1:B1=B1)))

Ready for next additional requirement ;-)

Lars-Ã…ke




All times are GMT +1. The time now is 01:34 PM.

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