[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Excel 2000 Custom alphanumeric Series

Posted on 2002-07-29
6
Medium Priority
?
364 Views
Last Modified: 2012-06-27
I have an alphanumeric numbering system. I need to sort it.

It goes:
A, AA, AB, AC, AD, AE... AZ then B, BA, BB, BC, BD, BE.... BZ then C, CA, CB, CC, CD... CZ then D, DA, DB through to Z, ZA, ZB, ZC.... etc. After that it's 1, 1A, 1B, 1C.. 1Z then 1AA, 1AB.... 1ZZ, 2A, 2B.... get the drift!?

Anyway, what's the best way to create this in Excel so I can sort my revision control data. I was amazed to find that Excel didn't have a basic alphabet series in the series list. It's not a million miles away from a hexadecimal system, so it can't be that hard.
I know I can type a huge list and then import a custom series, but is there a better way? Is a custom number format a better option?

Thanks,

Steve :)
0
Comment
Question by:Steve2276
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:Elmo_
ID: 7185003
Steve,

Just one or two Questions.

1.  When you start adding numbers to the list how high do you want to go?  Are you just just 1 or want to go to something like 10 on this.

2.  Should the list not follow suit after the inital alpha list?

E.g.

You have:
A, AA, AB, AC, AD, AE... AZ
1, 1A, 1B, 1C.. 1Z then 1AA, 1AB.... 1ZZ

Should it not be:
A, AA, AB, AC, AD, AE... AZ
1, 1A, 1AA, 1AB.. 1AZ then 1B, 1BA.... 1ZZ


Cheers,

Ed.
0
 

Author Comment

by:Steve2276
ID: 7185186
My list is already pre-defined.
I don't need to create a list as such, just order an existing list.
I figured the custom series route was the correct one to take - ie. it would determine the sort order. But I'm open to suggestions.

Steve
0
 
LVL 3

Expert Comment

by:Elmo_
ID: 7185231
Steve,

Sorry about that, I took up the question wrong.  I started to think about how to create the list.

OK.  Another one or two questions:

How do you currently have the list stored?

Are you trying to define how the list should be sorted?

cheers,

Ed.
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

Author Comment

by:Steve2276
ID: 7188515
The list is stored as a single column in Excel (extracted and manipulated from a text file)

Yes, I am trying to define how the list should be sorted.

Thanks.

;o)
0
 
LVL 16

Accepted Solution

by:
sebastienm earned 306 total points
ID: 7192014
It is actually far from hex or any alphanum system since
all of them are built on 'basis'. So, you could never get:
A<AB<C<CA as you series is.
Anyway...

1.
One painfull method would be to write ALL of them
in order (once) in a sheet column A, then assign row number
to column B
A 1
AB 2
...
then anywhere you need this index (col B), you could do a
Vlookup().

2.
Else, you can use the bellow VBA function in your
spreadsheet, it transforms the code into a number, then
eg: in col B, =FormatSeriesString(B1)
then order by this number. It should work.

This also assumes that i understand your series (???):
In order: (3 digit code max starting at A ending at 9ZZ)
A
AA
AB
AZ
B
BA
BZ
Z
ZA
ZZ
1
1A
1AB
1Z
1ZZ
2
2A
2AB
2AZ
2Z
9
9A
9AB
9AZ
9Z
9ZA
9ZZ
----------------------------------------------
Function FormatSeriesString(Cell As Variant) As String
    Dim s As String
    Dim s1 As String, s2 As String, s3 As String
    Dim num As Integer

    s = Cell.Value
    s1 = Left(s, 1)
    num = Len(s)
   
    Select Case num
    Case 1
        If IsNumeric(s1) Then
            s = s & "00"
        Else
            s = "0" & s & "0"
        End If
    Case 2
        If IsNumeric(s1) Then
            s = s & "0"
        Else
            s = "0" & s
        End If
    Case 3
        s = s
    Case Else
        s = "000"
    End Select
   
    s1 = Left(s, 1): s2 = Mid(s, 2, 1): s3 = Right(s, 1)
    FormatSeriesString = _
        (Asc(s1) - IIf(IsNumeric(s1), 48, 55))*(36 * 36) _
        + (Asc(s2) - IIf(IsNumeric(s2), 48, 55)) * 36 _
        + (Asc(s3) - IIf(IsNumeric(s3), 48, 55))
   
End Function
---------------------------------------------------------
Regards,
Sébastien
0
 

Author Comment

by:Steve2276
ID: 7193147
Okay, cheers. It's all looking a bit complex now. I'm not opposed to VBA stuff, and I'll give it a go. But I may have found a better field to sort by now!
Cheers.
:)
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question