# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  If cell is not blank, insert number

## NathanLedet

I'm trying to create a formula that, based on input, will increase the number next to it.

so, if B1 has text, then A1 will say "1. "
if B2 has text, then A2 will say "2. "

thanks for any assistance  :Smilie:

----------


## NBVC

Try:

=IF(B1<>"",COUNTIF($B$1:$B1,"<>")&".","")

copied down

----------


## NathanLedet

That works very well!  :Smilie:

----------


## NBVC

This should work too.

=IF(B1<>"",COUNTA($B$1:$B1)&".","")

----------


## NathanLedet

Thank you.

Can you help me understand the $B$1 portion of it? what are the dollar signs for?

----------


## NBVC

The $ makes the cell reference absolute (i.e. it "freezes" it) so that when you copy down the formula, it always references the top of the range to be B1.  The formula counts always from B1 to the current row (notice no $ in front of the 1 in the reference to the bottom of the range)...this changes as you copy down.

----------


## NathanLedet

Awesome, Thanks for the information  :Smilie:

----------

