Formula for Item Number (consective, ignoring blank lines)

JerBearG

New Member
Joined
Oct 4, 2014
Messages
12
Hello world!

1st post. I'm trying to generate item numbers for quoted items in my quoting template. It should be simple, but I can't figure out how to skip blank lines (which happen often in our world) and continue counting from the previous number.

Example:
Item # - Data - More Data
1 1" x 2" x 5"
2 1" x 3" x 5"

3 2" x 1" x 10"
4 2" x 2" x 5"


5 3" x 2" x 5"
6 3" x 3" x 5"
7 3" x 4" x 5"

I need code to generate those items numbers (**Sometimes there may be 2 blank lines in a row**). I could do this with VBA, but I want them to be fluid with simple excel code (unless I'm missing an easy way for them to auto update with VBA that isn't slow).

Thanks!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
This will work as long as your first data cell is not in Row 1. Put this formula in cell A2 and copy down...

=IF(B2="","",MAX(A$1:A1)+1)
 
Upvote 0
That looks great! What a good idea. Unfortunately, I can't get it to work. It keeps coming out as 0s. Even if I say, "= one of the 0 cells + 1", it still returns 0. I'm thinking its some formatting error, but I can't figure it out. The number formatting is fine.
 
Upvote 0

Forum statistics

Threads
1,216,743
Messages
6,132,462
Members
449,729
Latest member
davelevnt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top