• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Please help me to convert the hexadecimal data

Neha Miriyala

New Member
Good Evening,
The cells in file contains hexadecimal data. I have tried to format it into text. But it didn't work. I also tried HEX2DEC formula.
Please help me with this problem.
.Screenshot (31).png
 

Neha Miriyala


Did You take care formats?
Did You check that 'error'-note?
Could You send a sample file?
...without it - I could write that 'normal' file could work.

Syntax

HEX2DEC(number)

The HEX2DEC function syntax has the following arguments:

  • Number Required. The hexadecimal number you want to convert. Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.

Remark

If number is not a valid hexadecimal number, HEX2DEC returns the #NUM! error value.
 

Neha Miriyala

How could a sample file be too large to upload?
Do You have any image, what would be that (fd7c28f9fd8045f2) value be?
Screenshot 2024-06-21 at 17.55.21.png
You could modify above formula as Your needs Yourself.
 
Hmmm, That excel version seems modern enough to have Power Query on board.

I tried with the one value in the picture that's absolutely clear
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"some Hex", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.From(Expression.Evaluate("0x" & [some Hex])))
in
    #"Added Custom"

1718984696484.png

EDIT: added the example of Vletm. But I get other result.
1718984771097.png

Source: https://xxlbi.com/blog/converting-hexadecimal-to-decimal-numbers-in-power-query/
 

GraH - Guido

I didn't test it
... it seems to need some modifications.
Your non formula give better result.
Both below gives 18265519242872900000
=DECIMAL(B2,16)
=LET(L,LEN(B2),seq,SEQUENCE(L),SUM((FIND(MID(B2,seq,1),"0123456789ABCDEF")-1)*16^(L-seq)))
But ... Excel can show 15numbers and the rest are zeros.

Neha Miriyala

How do You get those values?
 
Last edited:
Back
Top