ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adding a number to every change in value (https://www.excelbanter.com/excel-discussion-misc-queries/50002-adding-number-every-change-value.html)

Breinn

adding a number to every change in value
 
I have a list of numerical items in column a, with corresponding info in
columns b-ab. I would like to a number to the item number at every change in
item. for example I would like to go from this:

10-1000
10-1000
10-1001
10-1001
10-1001
10-1003

to this:

10-1000 1
10-1000 1
10-1001 2
10-1001 2
10-1001 2
10-1003 3

the numbers are variable, as are the number of rows that they occupy.

Any thoughts much appreciated.

Breinn



Bob Phillips

B1: =A1&" " & 1
B2: =IF(A2=A1,B1,LEFT(B1,FIND(" ",B1))&RIGHT(B1,LEN(B1)-FIND(" ",B1)+1)+1)

--
HTH

Bob Phillips

"Breinn" wrote in message
...
I have a list of numerical items in column a, with corresponding info in
columns b-ab. I would like to a number to the item number at every change

in
item. for example I would like to go from this:

10-1000
10-1000
10-1001
10-1001
10-1001
10-1003

to this:

10-1000 1
10-1000 1
10-1001 2
10-1001 2
10-1001 2
10-1003 3

the numbers are variable, as are the number of rows that they occupy.

Any thoughts much appreciated.

Breinn





Breinn

Perfect. You are my Excel hero.

"Bob Phillips" wrote:

B1: =A1&" " & 1
B2: =IF(A2=A1,B1,LEFT(B1,FIND(" ",B1))&RIGHT(B1,LEN(B1)-FIND(" ",B1)+1)+1)

--
HTH

Bob Phillips

"Breinn" wrote in message
...
I have a list of numerical items in column a, with corresponding info in
columns b-ab. I would like to a number to the item number at every change

in
item. for example I would like to go from this:

10-1000
10-1000
10-1001
10-1001
10-1001
10-1003

to this:

10-1000 1
10-1000 1
10-1001 2
10-1001 2
10-1001 2
10-1003 3

the numbers are variable, as are the number of rows that they occupy.

Any thoughts much appreciated.

Breinn






Bob Phillips

I forgot to add ...

and copy down

But you knew that :-)

Bob

"Breinn" wrote in message
...
Perfect. You are my Excel hero.

"Bob Phillips" wrote:

B1: =A1&" " & 1
B2: =IF(A2=A1,B1,LEFT(B1,FIND(" ",B1))&RIGHT(B1,LEN(B1)-FIND("

",B1)+1)+1)

--
HTH

Bob Phillips

"Breinn" wrote in message
...
I have a list of numerical items in column a, with corresponding info

in
columns b-ab. I would like to a number to the item number at every

change
in
item. for example I would like to go from this:

10-1000
10-1000
10-1001
10-1001
10-1001
10-1003

to this:

10-1000 1
10-1000 1
10-1001 2
10-1001 2
10-1001 2
10-1003 3

the numbers are variable, as are the number of rows that they occupy.

Any thoughts much appreciated.

Breinn









All times are GMT +1. The time now is 02:26 AM.

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