Excel incrementing

Copper Contributor

Can someone please tell me how to increment by 1 the numbers only when you have letters with the numbers? For example: I have B-001A and need to increment the 001 by 1, so that when I drag it down I get B-002A, B-003A, etc. I know how to do it with just numbers, very easy but need help when there are letters involved.

 

Thanks

4 Replies

@Chris405 

If you try this formula, you only have to adapt it to your needs or cells.

 

=LEFT(A1,3) & RIGHT(A1,5)+1

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

You could also solve it with a VBA procedure:

Sub increment ()
Range ("A1"). Select 'A1 contains e.g. 0AK20001
Selection.AutoFill Destination: = Range ("A1: A30") 'The area A1: A30 is filled out so that 0AK20030 is in A30.
End Sub

You would have to adjust the area.

* It's always good to add your operating system and Excel version.

I would be happy to know if I could help.

Nikolino
I know I don't know anything (Socrates)

@Chris405 

Not what you want. But a 3:d cheating version

Put numbers in column A 

=ROW()

and use the number-format "00#"

at least 2 rows of Exemple data in B

Select B1:B9 press Ctrl+E for excels "intelligent" Flash Fill

001B-001A
002B-002A
003 
004 
005 
006 
007 
008 
009 

 

@Deleted 

 

just a suggestionjust a suggestion

 

Nikolino

I know I don't know anything (Socrates)