Forum Discussion

Busola40's avatar
Busola40
Copper Contributor
Jan 30, 2023

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

  • Busola40 

    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))

    • Busola40's avatar
      Busola40
      Copper Contributor
      Hi 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 thanks
      • Busola40 

        With 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))

Resources