Excel formula 3 letter but to include 1-9 as we

Kerr3189

New Member
Joined
Nov 4, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,
I’m looking for a formula that would be from aaa to z9z then start again.
So the middle letter goes from A-9 ( including 0 before 1) but doesn’t change until the last letter gets to Z
the last letter I just need to A to Z
and the same with the first letter but the first letter doesn’t change until the middle letter has gone to 9.
I’m also looking for it to be able to start from what ever sequence ( as having been doing manually and on BDZ) would also like to be able to put 170 at front of each 3 letter/number sequence.
Please help
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Someone else might have a more elegant solution, but this is mine. It does require a 6 character code to be right above the first instance of the code, and it automatically enters the "170" in front. If this doesn't work for you, please provide more information on what you are looking for.
="170" & IF(AND(MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),5,1)="9",RIGHT(INDIRECT(ADDRESS(ROW()-1,COLUMN())),1)="Z"),IF(MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),4,1)="Z","A",CHAR(CODE(MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),4,1))+1)),MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),4,1)) & IF(RIGHT(INDIRECT(ADDRESS(ROW()-1,COLUMN())),1)="Z",IF(MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),5,1)="Z","0",IF(MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),5,1)="9","A",CHAR(CODE(MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),5,1))+1))),MID(INDIRECT(ADDRESS(ROW()-1,COLUMN())),5,1)) & IF(RIGHT(INDIRECT(ADDRESS(ROW()-1,COLUMN())),1)="Z","A",CHAR(CODE(RIGHT(INDIRECT(ADDRESS(ROW()-1,COLUMN())),1))+1))
 
Upvote 0
Someone else might have a more elegant solution, but this is mine. It does require a 6 character code to be right above the first instance of the code, and it automatically enters the "170" in front. If this doesn't work for you, please provide more information on what you are looking for.
Hi that is so so close to be perfect thank you. The formula when input starts at 170BEA how do I get it to follow on from my previous manually input cell
 
Upvote 0
Hi that is so so close to be perfect thank you. The formula when input starts at 170BEA how do I get it to follow on from my previous manually input cell
A couple points here:
1. Place a 6 character string in a cell, then place this code in the cell below the manually entered string, then use the Fill Handle in the corner of the cell to expand downward.
2. This only works with downward expanding rows (the code can be modified to do rightward expanding columns by changing all of the Row()-1 to Row() and changing all the Column() to Column()-1 )
3. This code is set up to automatically add the "170" to the beginning, that can be changed to any set of 3 characters or can copy the first 3 characters of the last row by replacing "170" (and its quotes) with LEFT(INDIRECT(ADDRESS(ROW()-1,COLUMN())),3) (again this can be changed to work rightward making the same change listed above
4. This does as you asked, 4th character is A-Z, 5th character is A-Z-0-9, 6th character is A-Z (I only point this out for anyone trying to copy this code and wondering why this is happening)

Let me know if this helps or not, or if there are any tweaks/correction that need to be made.
 
Upvote 0
Try:

Cell Formulas
RangeFormula
A3:C10A3="170"& CHAR(MOD(CODE(MID(A2,4,1))-65+(RIGHT(A2,2)="9Z"),26)+65)& MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789A",SEARCH(MID(A2,5,1),"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")+(RIGHT(A2)="Z"),1)& CHAR(MOD(CODE(RIGHT(A2))-64,26)+65)


Put the starting value in the top row, then the formula below that. This formula will choose the next value based on what's above it.
 
Upvote 0
Solution
Upvote 0
Sorry all, I'm used to working with formulas that can figure out where they are and what's around them. All of my addressing is so you don't have to worry about which cell it's in.
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top