Convert multiple letters to ASCII and back to letters

skittlz

New Member
Joined
Oct 26, 2012
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I have a spreadsheet that manages revisions of different documents. I'm currently using this formula to convert letters to ASCII value:

=IFERROR(SUMPRODUCT(CODE(UPPER(MID(G2,ROW(INDIRECT("1:"&LEN(G2))),1)))),"")

1720455732563.png


I only want Capital letters, and this formula works. For A (or a), this formula gives me 65. For Z or z, i get 90. for AA, I get 130.

Problem: How do i convert 130 back to AA? My current formula is:

=IFERROR(CHAR(MAXIFS(Formulas!I:I,Formulas!A:A,'Training Matrix'!A7)),"")

For AA, I get a comma, for AB I get the "f" symbol, for AC i get 2 comas. Ideally, I need both formulas to work till ZZ.
1720455880720.png

Please help!
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Problem: How do i convert 130 back to AA? My current formula is:
I don't believe it's possible as the sum is not unique. For example, BB -> 66+66 =132, but it could've been A+C (65+67).

Also, you can avoid the volatile INDIRECT with newer Excel version.
Excel Formula:
=IFERROR(SUMPRODUCT(CODE(UPPER(MID(G2,SEQUENCE(LEN(G2)),1)))),"")
 
Upvote 0
I don't believe it's possible as the sum is not unique. For example, BB -> 66+66 =132, but it could've been A+C (65+67).

Also, you can avoid the volatile INDIRECT with newer Excel version.
Excel Formula:
=IFERROR(SUMPRODUCT(CODE(UPPER(MID(G2,SEQUENCE(LEN(G2)),1)))),"")
Crap - I forgot the sum is not unique. How about using that formula to find the "Highest" Ascii value, and then going to the text field to copy the rev? what I mean to say is :

Find the highest rev per =IFERROR(CHAR(MAXIFS(Formulas!I:I,Formulas!A:A,'Training Matrix'!A7)),""), then go to "Formulas Tab", and copy and paste the corresponding value in Column G?
 
Upvote 0
You'll run into another issue. For example, AZ has the same sum as ZA, which one to return?
 
Upvote 0
You'll run into another issue. For example, AZ has the same sum as ZA, which one to return?
great point - i didn't think about it. ZA vs AZ is roughly 650 revisions. I'd have the same issues much earlier - BA vs. AB - however that's easier to manage. I will eventually have to delete old data - my spreadsheet wouldn't be able to manage 26 revisions worth of entries anyway.
 
Upvote 0
Can you explain more on what you're trying to achieve with the revision? Perhaps there's a better approach.
 
Upvote 0
Hi Cubist - thank you for your patience. I needed a formula to find the "Highest" revision. For example, my spreadsheet has data like this in 4 columns:


Bob, Document10, A, Ascii value(A)
Bob, Document10, B, Ascii value(B)
Bob, Document10, C, Ascii value(C)
Bob, Document 10, D, Ascii value(D)
Bill, Document11, E, Ascii value(E)
Bill, Document11, F, Ascii value(F)
Joe, Document12, G, Ascii value(G)
Joe, Document12, H, Ascii value(H)

I needed an output to show that: Bob is Trained to Document10, Rev D, and Bill is trained to Document11, Rev F, Joe is trained to Document12, Rev H.

The best way I could figure out how to do it would be using maxifs of Ascii values.

Not sure if it makes sense.
 
Upvote 0
You can try this. It returns the latest record for each person.
Book1
ABCDEFG
1NameDocumentRevNameDocumentRev
2Bob Document10ABob Document 10D
3Bob Document10BBill Document11F
4Bob Document10CJoe Document12H
5Bob Document 10D
6Bill Document11E
7Bill Document11F
8Joe Document12G
9Joe Document12H
Sheet1
Cell Formulas
RangeFormula
E2:G4E2=CHOOSEROWS(A2:C9,XMATCH(UNIQUE(A2:A9),A2:A9,,-1))
Dynamic array formulas.
 
Upvote 0
Just to be sure...
Is a revision AA greater than Z?
Because if you let excel order it alpabetically it will give you something different:

NameDocumentRev
Bill Document11E
Bill Document11F
Bob Document10AA
Bob Document10C
Bob Document10Z
Bob Document10ZA
Joe Document12G
Joe Document12H


Maybe you can use something like this:

Book1
ABCD
1NameDocumentRevRev numerical
2Bill Document11E69
3Bill Document11F70
4Bob Document10AA6565
5Bob Document10C67
6Bob Document10Z90
7Bob Document10ZA9065
8Joe Document12G71
9Joe Document12H72
Sheet1
Cell Formulas
RangeFormula
D2:D9D2=LET(d, Sheet1!$C2, l, LEN(d), exp, SEQUENCE(,l,l-1,-1), s, SEQUENCE(,l), SUM(CODE(MID(d, s,1))*100^exp) )


To convert the text rev to numbers and then select the greatest?
 
Upvote 0
If desired, you can probably convert @felixstraube's Col D numerical value back to letter revisions with this formula

Excel Formula:
IF(LEN(D2)=4,CHAR(LEFT($D2,2)) & CHAR(RIGHT($D2,2)),CHAR($D2))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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