cell "if"

C

CJRolls

Hello, I need to have excel fill a cell only if there is a value in the cell
to the right. I.e Column A1 increases by 1 whenever I enter a value in column
B2 and so on down the sheet. Thanks
 
M

Max

CJRolls said:
Hello, I need to have excel fill a cell only
if there is a value in the cell
to the right. I.e Column A1 increases by 1
whenever I enter a value in column
B2 and so on down the sheet. Thanks

One guess ..

Assuming B1 contains a label,
put in A1: =IF(COUNTA(B:B)=1,"",COUNTA(B:B)-1)
 
C

CJRolls

Thanks Max but I can only show a value in column A if there is a value in
column B. I enter information in to column B and need a formula to fill down
in column B that counts the lines as information is entered into B. Many
thanks.

A B
1 1 25623
2 2 214
3 3 587455
4
 
D

daddylonglegs

Try this formula in A1 copied down

=IF(B1,COUNT(B$1:B1),"")

if column B just contains numbers, if possibly text

=IF(LEN(B1),COUNTA(B$1:B1),""
 
M

Max

CJRolls:

Believe you've changed your specs in your response <g>

Couldn't help but feel that what you're looking for
is a simple auto-row numbering in col A
which appears "blank" until something is entered in col B

In which case, think we could also place in A1:
=IF(B1="","",ROWS($A$1:A1))
and copy A1 down as far as required
 
M

Max

In which case, think we could also place in A1:
=IF(B1="","",ROWS($A$1:A1))
and copy A1 down as far as required

The above presumes data in col B will be entered sequentially down the col
w/o skips (as per post). If there's the possibility of skips, go with
daddylonglegs's suggestions. And if you were to insert new rows in-between
subsequently,
just re-fill the formula in col A from the top cell.
 
M

Marc

I'm using this formula to count my records =IF(LEN(B1),COUNTA(B$1:B1),"")
Is there a way to add letters to the count. I want it to count like this in
the spreadsheet.

ALE1
ALE2
ALE3
ALE4
ALE5...
 
Top