hex number recognition

trsnider

New Member
Joined
May 24, 2011
Messages
3
Is there any way to get Excel 2007 to recognize a hex number using the 0x... format? Hex numbers in quotes "deadface" seems really useless.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Thanks - I had read that in other searches prior to posting.
Under data -> data analysis I don't see any conversion related macros.
Is there another place I should be looking (brain dead today).
 
Upvote 0
=Hex2Dec("ABCD") returns 43981.

if you're using Excel 2003- and get a #NAME? error, Tools > Addins, tick Analysis Toolpak.
 
Upvote 0
I'll be more specific I'm using a file that has hex numbers in the form 0x...
Optimally I'd like to be able to use them 'as is' in functions (min, max, average...) without manipulating them just to satisfy excel's quirkyness.
That apparently isn't possible -- even with the analysis pack loaded -- (no applicable functions are seen in it).

So I can edit the file outside of excel & remove '0x's.
But when I copy the column in excel thinks it's smarter than me and converts numbers with an embedded '0e' to scientific notation.

Workarounds:
a: format the column as text -
remove the 0x in an editor, copy the column from an editor - paste it in using either (ctl+c or paste special 'text') -- b: changing column formats between general and text don't seem to help.
c: using text to columns specifying the format as text or general doesn't help.

the files are huge 500,000+ lines so it's impractical to go thru by hand and correct each one.
 
Upvote 0
Optimally I'd like to be able to use them 'as is' in functions (min, max, average...) without manipulating them just to satisfy excel's quirkyness.

What spreadsheet application does not have this so-called quirkiness? As far as I know Excel, OOorg, LibreOffice, Gnumeric all do not natively recognize Hex data in cells.

It may be simplest to convert the whole column to DEC all at once and get with life. If you need Hex back again for output, convert back to Hex.
 
Last edited:
Upvote 0
Ditto.

A macro to convert a column of values from hex to decimal or vice versa would only require a few lines of code and a few seconds for a half million cells.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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