ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help creating a formula that repeats text & increments an integer (https://www.excelbanter.com/excel-discussion-misc-queries/238402-help-creating-formula-repeats-text-increments-integer.html)

djow

Help creating a formula that repeats text & increments an integer
 
I been trying to create a formula that repeats the same text characters in
each consecutive cell in a column but increments the integer by one (see
example below):
A1 = AB-0
A2 = AB-1
A3 = AB-2...

I believe I can take care of the text by using the function =LEFT(A1,3) but
I haven't been able to figure out how to add the formula to increment the
integer. I tried to just add "+1" at the end of the formula, but got the
#VALUE! error. I tried searching past posts and the Excel help menu, but
didn't see any entries that addressed this question.

Thx in advance for any help

Fred Smith[_4_]

Help creating a formula that repeats text & increments an integer
 
Try something like this:
=left(a1,3)&text(right(a1,1)+1,"0")

Regards,
Fred

"djow" wrote in message
...
I been trying to create a formula that repeats the same text characters in
each consecutive cell in a column but increments the integer by one (see
example below):
A1 = AB-0
A2 = AB-1
A3 = AB-2...

I believe I can take care of the text by using the function =LEFT(A1,3)
but
I haven't been able to figure out how to add the formula to increment the
integer. I tried to just add "+1" at the end of the formula, but got the
#VALUE! error. I tried searching past posts and the Excel help menu, but
didn't see any entries that addressed this question.

Thx in advance for any help



Pete_UK

Help creating a formula that repeats text & increments an integer
 
Here's one way (placed in A2, with A1 containing AB-0 as shown):

=LEFT(A1,3)&ROW(A1)

Copy down as required. If you want leading zeros for the number, so
the entries are all the same length, then you could use:

=LEFT(A1,3)&TEXT(ROW(A1),"000")

which will give you AB-001, AB-002, AB-003 etc.

Hope this helps.

Pete

On Jul 29, 11:36*pm, djow wrote:
I been trying to create a formula that repeats the same text characters in
each consecutive cell in a column but increments the integer by one (see
example below):
A1 = AB-0
A2 = AB-1
A3 = AB-2...

I believe I can take care of the text by using the function =LEFT(A1,3) but
I haven't been able to figure out how to add the formula to increment the
integer. *I tried to just add "+1" at the end of the formula, but got the
#VALUE! error. I tried searching past posts and the Excel help menu, but
didn't see any entries that addressed this question.

Thx in advance for any help



Shane Devenshire[_2_]

Help creating a formula that repeats text & increments an integer
 
Of course you can increment this by just dragging the fill handle down, no
formula necessary.

If you want a formula enter

="AB-"&ROW()

in A1 and copy it down.

The formula =LEFT(A1,3)&TEXT(RIGHT(A1,1)+1,"0")
will not work after 9.


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"djow" wrote:

I been trying to create a formula that repeats the same text characters in
each consecutive cell in a column but increments the integer by one (see
example below):
A1 = AB-0
A2 = AB-1
A3 = AB-2...

I believe I can take care of the text by using the function =LEFT(A1,3) but
I haven't been able to figure out how to add the formula to increment the
integer. I tried to just add "+1" at the end of the formula, but got the
#VALUE! error. I tried searching past posts and the Excel help menu, but
didn't see any entries that addressed this question.

Thx in advance for any help



All times are GMT +1. The time now is 04:38 AM.

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