Forum Discussion
Busola40
Jan 30, 2023Copper Contributor
Excel
Hello, I want increase the last digit of a cell containing various numbers by 1 after every four roles. For example, 03-L-056-A,
03-L-056-B
03-L-056-C
03-L-056-D
And then 03-L-057-A
03-L-057-B
03-L-057-C etc
Is this possible?
Thank you
4 Replies
Let's say the first value is in cell A1.
Enter the following formula in A2, then fill down.
=LEFT(A1,5)&TEXT(MID(A1,6,3)+(RIGHT(A1)="D"),"000")&"-"&CHAR(65+MOD(CODE(RIGHT(A1)),4))
- Busola40Copper ContributorHi again HansVogelaar. Another quick question please. What will be the formula if I want the number to go down instead? for example 03-L-046-A, 03-L-046-B, and then 03-L-045-A, 03-L-045-B etc.
Many thanksWith just A an B, that would be
=LEFT(A1,5)&TEXT(MID(A1,6,3)-(RIGHT(A1)="B"),"000")&"-"&CHAR(65+MOD(CODE(RIGHT(A1)),2))
- Busola40Copper Contributor
HansVogelaar , Thank you so much. It worked and has saved me an immense amount of time.