ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need help in numbering a column while skipping lines (https://www.excelbanter.com/excel-worksheet-functions/61449-need-help-numbering-column-while-skipping-lines.html)

Gary Reger

Need help in numbering a column while skipping lines
 
data that i have is

a b c d
jh address telephone number
ar address telephone number
address telephone number

ar address telephone number

column a needs needs number 1,2,3,4,5, etc.
but only if column be is jh or ar
and they need to be consecutive like you use with autofill numbering
but it needs to skip the spaces and yet keep the numbering in order

Harlan Grove

Need help in numbering a column while skipping lines
 
Gary Reger wrote...
data that i have is

a b c d
jh address telephone number
ar address telephone number
address telephone number

ar address telephone number

column a needs needs number 1,2,3,4,5, etc.
but only if column be is jh or ar
and they need to be consecutive like you use with autofill numbering
but it needs to skip the spaces and yet keep the numbering in order


If your topmost row is in row 1, so the topmost col A cell would be A1,
then try these formulas.

A1:
=IF(OR(B1={"jh","ar"}),1,"")

A2:
=IF(OR(B2={"jh","ar"}),1+MAX(A$1:A1),"")

Fill A2 down as far as needed.


Gary Reger

Need help in numbering a column while skipping lines
 
it did not work here is what i got

1 JH
1 JH
1 AR
1 AR
1 JH
1 JH
1 JH
2 AR
2 JH
2 JH
2 JH
2 JH
2 JH

AR

AR

3 JH
3 AR





4 JH


4 JH
4 JH
4 JH
JH
AR

5 AR



5 JH

5 JH
6 JH
6 AR
6 JH
6 JH


"Harlan Grove" wrote:

Gary Reger wrote...
data that i have is

a b c d
jh address telephone number
ar address telephone number
address telephone number

ar address telephone number

column a needs needs number 1,2,3,4,5, etc.
but only if column be is jh or ar
and they need to be consecutive like you use with autofill numbering
but it needs to skip the spaces and yet keep the numbering in order


If your topmost row is in row 1, so the topmost col A cell would be A1,
then try these formulas.

A1:
=IF(OR(B1={"jh","ar"}),1,"")

A2:
=IF(OR(B2={"jh","ar"}),1+MAX(A$1:A1),"")

Fill A2 down as far as needed.



Gary Reger

Need help in numbering a column while skipping lines
 
I am sorry this did work. ignore my other reply please

thank you very much for your help

"Harlan Grove" wrote:

Gary Reger wrote...
data that i have is

a b c d
jh address telephone number
ar address telephone number
address telephone number

ar address telephone number

column a needs needs number 1,2,3,4,5, etc.
but only if column be is jh or ar
and they need to be consecutive like you use with autofill numbering
but it needs to skip the spaces and yet keep the numbering in order


If your topmost row is in row 1, so the topmost col A cell would be A1,
then try these formulas.

A1:
=IF(OR(B1={"jh","ar"}),1,"")

A2:
=IF(OR(B2={"jh","ar"}),1+MAX(A$1:A1),"")

Fill A2 down as far as needed.




All times are GMT +1. The time now is 11:13 PM.

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