numbering rows, but skipping blanks

G

Guest3731

I'm using Column A of a spreadsheet to number some items in Column B.
I've been using Excel's automatic series-filling function, where you
drag down from the lower right corner of a cell. However, since some
of the rows in Column B are empty, and I don't want them numbered, I
have to stop numbering and manually "jump" over the blanks in Column
A. Is there a way to automatically number down in Column A, while
skipping over the blanks and continuing where I left off? I.e.

1
2


3
4

5

? Thanks much.
 
R

RagDyeR

Try this in A1:

=IF(B1<>"",COUNTA($B$1:B1),"")

And copy down as needed.
--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================


I'm using Column A of a spreadsheet to number some items in Column B.
I've been using Excel's automatic series-filling function, where you
drag down from the lower right corner of a cell. However, since some
of the rows in Column B are empty, and I don't want them numbered, I
have to stop numbering and manually "jump" over the blanks in Column
A. Is there a way to automatically number down in Column A, while
skipping over the blanks and continuing where I left off? I.e.

1
2


3
4

5

? Thanks much.
 
D

Daniel.C

In cell A1, paste :
=IF(B1="","",COUNTA($B$1:B1))
then, drag down.
Regards.
Daniel
 
B

Bernard Liengme

Enter your starting value in A1
In A2 use =IF(ISBLANK(B2),"",MAX($A$1:A1)+1)
Adjust cell references if you are starting in other than A1
best wishes
 
G

Guest3731

Enter your starting value in A1
In A2 use =IF(ISBLANK(B2),"",MAX($A$1:A1)+1)
Adjust cell references if you are starting in other than A1
best wishes


Thanks for all of these helpful replies - much obliged.
 
G

Guest3731

Thanks for all of these helpful replies - much obliged.


Hey, not to be a pest, but can this be modified so as to skip over
(not number) A1 if B1 is either blank (empty), or contains a string
containing " no " as a substring? Thanks, if you have a minute for
this -
 
R

RagDyer

What type of data is in Column B ... text, numbers, or both?

Would you want "Nobel Prize" and "hypnotize" to be numbered or skipped?
 
G

Guest3731

RagDyer said:
What type of data is in Column B ... text, numbers, or both?

Would you want "Nobel Prize" and "hypnotize" to be numbered or skipped?

It is all text - and I guess what I would want to have skipped
(besides the blank B rows) would be "no ", case-insensitive - that is,
an "n", an "o", and some whitespace. Does that make sense?

Many thanks.
 
R

RagDyeR

You'll have to *manually* number A1 if B1 meets the criteria.

Then, enter this formula in A2, and copy down as needed:

=IF(OR(B2="",ISNUMBER(SEARCH("no ",B2))),"",MAX($A$1:A1)+1)

Since you said:
<<<" "no ", case-insensitive - that is, an "n", an "o", and some
whitespace.">>>

An individual "No", or "no" *will* be numbered, since there is no space
after the "o".


--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

RagDyer said:
What type of data is in Column B ... text, numbers, or both?

Would you want "Nobel Prize" and "hypnotize" to be numbered or skipped?

It is all text - and I guess what I would want to have skipped
(besides the blank B rows) would be "no ", case-insensitive - that is,
an "n", an "o", and some whitespace. Does that make sense?

Many thanks.
 
G

Guest3731

You'll have to *manually* number A1 if B1 meets the criteria.

Then, enter this formula in A2, and copy down as needed:

=IF(OR(B2="",ISNUMBER(SEARCH("no ",B2))),"",MAX($A$1:A1)+1)

Since you said:
<<<" "no ", case-insensitive - that is, an "n", an "o", and some
whitespace.">>>

An individual "No", or "no" *will* be numbered, since there is no space
after the "o".

Thanks!
 

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

Similar Threads


Top