ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   enter numbers in blank cells (https://www.excelbanter.com/excel-worksheet-functions/46450-enter-numbers-blank-cells.html)

bill gras

enter numbers in blank cells
 
I have a formula as follows, IF(B2="DISTANCE",MAX($A$1:A1)+1,"")
this works great, but I also need to have the blank cells in between the
numbers filled in with numbers eg:

I have need to have:
A1 1 A1 1
A2 blank A2 1
A3 blank A3 1
A4 2 A4 2
A5 blank A5 2
A6 blank A6 2
A7 blank A7 2
A8 blank A8 2
A9 blank A9 2
A10 3 A10 3
A11 blank A11 3
down to 300 rows
Can any one help me please ?

Thank You All
regards bill gras
--
bill gras

Duke Carey

It's not entirely clear what the problem is. Does your formula reside in
column A? If so, then try th is variation:

=MAX($A$1:A1)+IF(B2="DISTANCE",1,0)

"bill gras" wrote:

I have a formula as follows, IF(B2="DISTANCE",MAX($A$1:A1)+1,"")
this works great, but I also need to have the blank cells in between the
numbers filled in with numbers eg:

I have need to have:
A1 1 A1 1
A2 blank A2 1
A3 blank A3 1
A4 2 A4 2
A5 blank A5 2
A6 blank A6 2
A7 blank A7 2
A8 blank A8 2
A9 blank A9 2
A10 3 A10 3
A11 blank A11 3
down to 300 rows
Can any one help me please ?

Thank You All
regards bill gras
--
bill gras


Gary''s Student

Another option, from row 2 on, is to replace the "" in your fomula with A1.
That way, instead of a blank, you would carry down the value from the row
above.
--
Gary''s Student


"Duke Carey" wrote:

It's not entirely clear what the problem is. Does your formula reside in
column A? If so, then try th is variation:

=MAX($A$1:A1)+IF(B2="DISTANCE",1,0)

"bill gras" wrote:

I have a formula as follows, IF(B2="DISTANCE",MAX($A$1:A1)+1,"")
this works great, but I also need to have the blank cells in between the
numbers filled in with numbers eg:

I have need to have:
A1 1 A1 1
A2 blank A2 1
A3 blank A3 1
A4 2 A4 2
A5 blank A5 2
A6 blank A6 2
A7 blank A7 2
A8 blank A8 2
A9 blank A9 2
A10 3 A10 3
A11 blank A11 3
down to 300 rows
Can any one help me please ?

Thank You All
regards bill gras
--
bill gras



All times are GMT +1. The time now is 04:24 PM.

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