PC Review


Reply
Thread Tools Rate Thread

How to add a "running count" to cells with matching data

 
 
WA
Guest
Posts: n/a
 
      7th Jun 2010
I want to copy column A (below) into Column B and add a running count.
As long as column A is the same (repeat letters & numbers) - it keeps adding
the next number (1,2,3 . . . up to 99).
Example - Cols A & B, Rows 1-15. I have Col A. I need to create Col B:
Row ColumnA ColumnB
1 AK-1 AK-1-1
2 AK-1 AK-1-2
3 AK-1 AK-1-3
4 AK-2 AK-2-1
5 AK-2 AK-2-2
6 AK-3 AK-3-1
7 AK-1289 AK-1289-1
8 AK-1289 AK-1289-2
9 CA-1 CA-1-1
10 CA-1 CA-1-2
11 CA-2 CA-2-1
12 CA-2 CA-2-2
13 CA-2 CA-2-3
14 CA-375 CA-375-1
15 CA-375 CA-375-2
....
24 CA-375 CA-375-11

Column A will always be 2 letters, a "-" and 1 to 4 digits (ex: TX-1 up to
TX-9999)
Column B will always be a copy of Column A + a "-" and 1 to 2 digits (ex:
TX-1-1 to TX-9999-99).

What formula can I write to create Column B?

Thank you!

 
Reply With Quote
 
 
 
 
Javed
Guest
Posts: n/a
 
      7th Jun 2010
On Jun 7, 9:15*am, WA <W...@discussions.microsoft.com> wrote:
> I want to copy column A (below) into Column B and add a running count.
> As long as column A is the same (repeat letters & numbers) - it keeps adding
> the next number (1,2,3 . . . up to 99). *
> Example - Cols A & B, Rows 1-15. *I have Col A. *I need to create ColB:
> Row * * ColumnA ColumnB
> 1 * * * AK-1 * *AK-1-1
> 2 * * * AK-1 * *AK-1-2
> 3 * * * AK-1 * *AK-1-3
> 4 * * * AK-2 * *AK-2-1
> 5 * * * AK-2 * *AK-2-2
> 6 * * * AK-3 * *AK-3-1
> 7 * * * AK-1289 AK-1289-1
> 8 * * * AK-1289 AK-1289-2
> 9 * * * CA-1 * *CA-1-1
> 10 * * *CA-1 * *CA-1-2
> 11 * * *CA-2 * *CA-2-1
> 12 * * *CA-2 * *CA-2-2
> 13 * * *CA-2 * *CA-2-3
> 14 * * *CA-375 *CA-375-1
> 15 * * *CA-375 *CA-375-2
> ...
> 24 * * *CA-375 *CA-375-11
>
> Column A will always be 2 letters, a "-" and 1 to 4 digits (ex: TX-1 up to
> TX-9999)
> Column B will always be a copy of Column A + a "-" and 1 to 2 digits (ex:
> TX-1-1 to TX-9999-99).
>
> What formula can I write to create Column B?
>
> Thank you!


=+A1&"-"&COUNTIF($A$1:A1,A1)

You need to copy it in b1 cell first then paste in beloww cells from
b1.(This required for right copy of absolute/relative addresss
 
Reply With Quote
 
WA
Guest
Posts: n/a
 
      7th Jun 2010
PERFECT! Thank you so much!
--
WA


"Javed" wrote:

> On Jun 7, 9:15 am, WA <W...@discussions.microsoft.com> wrote:
> > I want to copy column A (below) into Column B and add a running count.
> > As long as column A is the same (repeat letters & numbers) - it keeps adding
> > the next number (1,2,3 . . . up to 99).
> > Example - Cols A & B, Rows 1-15. I have Col A. I need to create Col B:
> > Row ColumnA ColumnB
> > 1 AK-1 AK-1-1
> > 2 AK-1 AK-1-2
> > 3 AK-1 AK-1-3
> > 4 AK-2 AK-2-1
> > 5 AK-2 AK-2-2
> > 6 AK-3 AK-3-1
> > 7 AK-1289 AK-1289-1
> > 8 AK-1289 AK-1289-2
> > 9 CA-1 CA-1-1
> > 10 CA-1 CA-1-2
> > 11 CA-2 CA-2-1
> > 12 CA-2 CA-2-2
> > 13 CA-2 CA-2-3
> > 14 CA-375 CA-375-1
> > 15 CA-375 CA-375-2
> > ...
> > 24 CA-375 CA-375-11
> >
> > Column A will always be 2 letters, a "-" and 1 to 4 digits (ex: TX-1 up to
> > TX-9999)
> > Column B will always be a copy of Column A + a "-" and 1 to 2 digits (ex:
> > TX-1-1 to TX-9999-99).
> >
> > What formula can I write to create Column B?
> >
> > Thank you!

>
> =+A1&"-"&COUNTIF($A$1:A1,A1)
>
> You need to copy it in b1 cell first then paste in beloww cells from
> b1.(This required for right copy of absolute/relative addresss
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
count cells in a document, but excude cells with a "0" R.M. Microsoft Excel Misc 1 26th Apr 2010 10:19 PM
Create Pivot Table Data with Column "Sum" rather than "count" defa Johnny_99 Microsoft Excel Misc 2 2nd Jan 2010 03:25 PM
Pivot (Data Items "Count" vs "Sum") Ken Microsoft Excel Misc 2 11th Nov 2009 12:46 PM
Count cells that contain "Y" in columnA IF contains"X" in columnB =?Utf-8?B?aG9sbGllZGF2aXM=?= Microsoft Excel Worksheet Functions 6 20th Jul 2006 06:12 PM
Data "Point" in graph not matching table =?Utf-8?B?QnJpYW4=?= Microsoft Excel Charting 1 16th Dec 2005 05:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:37 AM.