If you have Office 365:
=TEXTJOIN(" ",,CODE(MID(A1,SEQUENCE(LEN(A1)),1)))
or
= ARRAYTOTEXT(CODE(MID(A1,SEQUENCE(LEN(A1)),1)),0)
If you have Office 365:
=TEXTJOIN(" ",,CODE(MID(A1,SEQUENCE(LEN(A1)),1)))
or
= ARRAYTOTEXT(CODE(MID(A1,SEQUENCE(LEN(A1)),1)),0)
For Excel 2016, a formula-based solution will only be feasible for strings containing no more than 5 characters, viz:
=TRIM(SUBSTITUTE(SUBSTITUTE(TEXT(SUMPRODUCT(10^(15-3*(ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1)))-1))*CODE(MID(A1,ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1))),1))),REPT(" 000",6))," 00"," ")," 0"," "))
Otherwise, you'll require VBA.
Convert a string of hex to ASCII
Decimal To Ascii In Excel
Importing a huge ASCII file that doesn't have delimiters?
*.spc to text/xlsx?
How do I convert ASCII codes back to characters?
What ASCII codes should I know for common validation scenarios?
What's the difference between CODE and UNICODE functions?
Videos
Hey,
I have a desire to convert strings from 20 to 250 characters in length from hex pairs to ASCII. So for example "Hello, world!" is (without the quotes) is represented by 48656C6C6F2C20776F726C6421.
I have built a sheet in my workbook to do this, but it is brutally huge, because I basically made 125 columns to separate each pair, then 125 more columns to convert the hex value to dec, then 125 MORE columns to convert the dec value to ASCII, and one final column to TEXTJOIN the whole mess.
I realize now I could probably reduce a lot of those middle steps by combining my equations, i.e. char(hex2dec(mid(D2,n,2))) (where n is 1, 3, 5, ...) but that still leaves me with 125 columns to textjoin. Bonus - as I said this can range from 20 to 250 characters in length, so I need to take that into consideration. The quick & (very) dirty method I'm using above simply converts 125 pairs even if there aren't 125 to do - my equations just put blank cells in place of invalid ranges (i.e. if the message is only 200 characters long, there are 25 blank columns at the end) - this doesn't pad my message out with spaces in the textjoin, but if building some kind of code to automate this with a much smaller set of equations, I figure that will need to be taken into consideration.
I'm not good with functions, macros, or VB. I prefer to work in equations because I at least understand them. If you intend to suggest something like that, I may need some additional hand-holding.
Any thoughts? I'm sure there's something much simpler I'm overlooking.
Thanks!