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.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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?
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.
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
Hi,
If you need more help, you can post your latest condition.
Regards,
Eric
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