Excel ASCII to HEX Conversion

Anonymous
2020-04-27T15:35:18+00:00

I need to convert an ASCII Value (Cell A1) to a HEX Value (Cell A2). 

Example: A1=HELP, A2 should calculate and display 48 45 4c 50.

How is this possible?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2020-04-27T16:08:02+00:00

    This array formula should produce the results you are looking for.

    =TEXTJOIN(char(32), true, dec2hex(code(mid(A1, row(indirect("1:"&len(A1))), 1))))

    This formula needs to be finished with Ctrl+Shift+Enter not just Enter.

    28 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-04-27T15:56:49+00:00

    Hi,

    Please try 

    =DEC2HEX(CODE(MID(A1,1,1)))&DEC2HEX(CODE(MID(A1,2,1)))&DEC2HEX(CODE(MID(A1,3,1)))&DEC2HEX(CODE(MID(A1,4,1)))

    Regards,

    Eric

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-04-29T16:33:15+00:00

    Hi,

    If you need more help, you can post your latest condition. 

    Regards,

    Eric

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-05-04T09:37:36+00:00

    Here is the summary for the case so that anyone with the same concern can check the case conveniently.

    Issue Symptom:


    convert an ASCII Value (Cell A1) to a HEX Value (Cell A2)

    Environment


    Office 365 for business/Excel

    Recommendation:


    Please try 

    =DEC2HEX(CODE(MID(A1,1,1)))&DEC2HEX(CODE(MID(A1,2,1)))&DEC2HEX(CODE(MID(A1,3,1)))&DEC2HEX(CODE(MID(A1,4,1)))

    Or

    =TEXTJOIN(char(32), true, dec2hex(code(mid(A1, row(indirect("1:"&len(A1))), 1))))

    Regards,

    Eric

    3 people found this answer helpful.
    0 comments No comments