Number rows but reset after a blank cell is encountered

excel_2009

Active Member
Joined
Sep 14, 2009
Messages
318
Hi Excel gurus,

I have the following formula which assigns a number to a cell

Code:
=IF(E2="","",COUNTA($E$2:E2))

It works great however I have a small issue in relation to when a blank value is in a cell, I'd like for the numbers to reset to 1 and increment (instead of continuing to increment irresepctive of coming across a blank cell):

Desired result:


COLUMN E
FORMULA COLUMN
A
1
B
2
C
3
E
1
D
2
G
3
H
4
I
5
Y
1
U
2
I
3

<tbody>
</tbody>

Instead of the following current issue:

COLUMN E
FORMULA COLUMN
A
1
B
2
C
3
E
4
D
5
G
6
H
7
I
8
Y
9
U
10
I
11

<tbody>
</tbody>

Please can someone help? :)
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Maybe..
Excel Workbook
EFG
1Header*Header
2A*1
3B*2
4C*3
5D*4
6***
7E*1
8F*2
9***
3



Hope that helps.
 
Upvote 0
Hi Howard,

I've tried the formulas but the results are not as expected, there are instances of numbers being duplicated and the value does not reset when a blank is encountered? is it possible to use one formula and drag that down?
 
Upvote 0
Hi Howard,

I've tried the formulas but the results are not as expected, there are instances of numbers being duplicated and the value does not reset when a blank is encountered? is it possible to use one formula and drag that down?

Seems to work on my sheet.

Howard


Excel 2012
EF
111
2q2
333
4 
551
6x2
773
884
995
10 
11111
12w2
13133
14 
15q1
16w2
17w3
18 
19q1
20w2
21e3
Sheet4
Cell Formulas
RangeFormula
F1=IF(E1<>0,1,"")
F2=IFERROR(IF(E2<>0,F1+1,""),1)
F3=IFERROR(IF(E3<>0,F2+1,""),1)
F4=IFERROR(IF(E4<>0,F3+1,""),1)
F5=IFERROR(IF(E5<>0,F4+1,""),1)
F6=IFERROR(IF(E6<>0,F5+1,""),1)
F7=IFERROR(IF(E7<>0,F6+1,""),1)
F8=IFERROR(IF(E8<>0,F7+1,""),1)
F9=IFERROR(IF(E9<>0,F8+1,""),1)
F10=IFERROR(IF(E10<>0,F9+1,""),1)
F11=IFERROR(IF(E11<>0,F10+1,""),1)
F12=IFERROR(IF(E12<>0,F11+1,""),1)
F13=IFERROR(IF(E13<>0,F12+1,""),1)
F14=IFERROR(IF(E14<>0,F13+1,""),1)
F15=IFERROR(IF(E15<>0,F14+1,""),1)
F16=IFERROR(IF(E16<>0,F15+1,""),1)
F17=IFERROR(IF(E17<>0,F16+1,""),1)
F18=IFERROR(IF(E18<>0,F17+1,""),1)
F19=IFERROR(IF(E19<>0,F18+1,""),1)
F20=IFERROR(IF(E20<>0,F19+1,""),1)
F21=IFERROR(IF(E21<>0,F20+1,""),1)
 
Upvote 0

Forum statistics

Threads
1,215,475
Messages
6,125,028
Members
449,205
Latest member
Eggy66

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