Numbering non-blank rows in template

G0ldens

New Member
Joined
May 29, 2012
Messages
1
I am looking for a way to dynamically number non-blank rows in a quote template (ie Item #).

The Template looks as follows:
B1 C1 D1
Item # Qty Description ...
1 2 Product A
2 1 Product B

3 4 Product C

If I add a row in between item 1 & 2, I would like all items to re-number properly. If I move the row for Product B down to the bottom (basically park it outside the template for possible addition later), I would also like all items to renumber properly.

non-blank rows should not be numbered.

I tried this:
=IF(C32 >0, (ROW(B32)-ROW($B$22)- COUNTBLANK($B$22:B31)),"")

where C32 = is the Qty, and $B$22 is the top of the column in the template where I need to start counting.

This formula works except if I move a row to somewhere at the bottom (creates a circular reference).

Thoughts, ideas or an easier suggestion for creating a dynamic range that goes from the top of the template to the current row.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,223,247
Messages
6,171,004
Members
452,374
Latest member
keccles

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