Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Excel in Hex hunt.

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
Xela
VIP member
VIP member
Posts: 225
Joined: Sun Jul 31, 2005 4:12 am
Been thanked: 1 time

Excel in Hex hunt.

Post by Xela »

Excel can be a pretty nifty tool to convert Xex to Dec with the macro function like =HEX2DEC. This one, as the name indicates, will convert hex to decimal in Little Endian byte order. I was wondering though if there was some other spreadsheet function for floats ?
Xela
VIP member
VIP member
Posts: 225
Joined: Sun Jul 31, 2005 4:12 am
Been thanked: 1 time

Post by Xela »

Going through my old posts and try update what I have learned since I posted the question. About that Excel thing maybe someone may find this helpful:
http://digilander.libero.it/foxes/xnumber_review_20.htm
I thought I 'd share.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Post by Rheini »

Why don't you simply use a hex editor?
Xela
VIP member
VIP member
Posts: 225
Joined: Sun Jul 31, 2005 4:12 am
Been thanked: 1 time

Post by Xela »

Why don't you simply use a hex editor?
I was looking for spredsheet type conversion floats in one column and DEC values in another. Translating many floating point coordinates of vertices.
but ....
For now I DO, as no other option really found. List of them for some of the models gets to be pretty loooong.
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

Depends on the format of the floating point. You do know, that unlike, integers, there are many different floating point formats. Perhaps you mean a specific IEEE format?
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Xela
VIP member
VIP member
Posts: 225
Joined: Sun Jul 31, 2005 4:12 am
Been thanked: 1 time

Post by Xela »

Sorry did not notice this earlier...
I know that there are different floating point formats , but since I am self learner not much beyond that:

3d 25 a7 40 = 5.22329569 e+000

What format would that be?
Rahly
VVIP member
VVIP member
Posts: 411
Joined: Thu Aug 05, 2004 10:17 am
Been thanked: 1 time

Post by Rahly »

Single Precision 32-Bit IEEE 754 Format

http://en.wikipedia.org/wiki/IEEE_754
"By nature men are alike. Through practice they have become far apart." Confucius (Analect 17:2)
Xela
VIP member
VIP member
Posts: 225
Joined: Sun Jul 31, 2005 4:12 am
Been thanked: 1 time

Post by Xela »

I know its no Excel support forum, but maybe by chance someone from this community wuld be willing and able to help me sort out this perhaps pretty basic Excel task.

I have bunch of of numbers formated with 6 decimal places. I need to round each of them (up or down) to closest 1/8th (0.125) increment:
16.277790 = 16. 250000
18.745009= 18.750000

Call me thick, but I cannot figure how to do it :( .
User avatar
Dinoguy1000
Site Admin
Posts: 786
Joined: Mon Sep 13, 2004 1:55 am
Has thanked: 154 times
Been thanked: 163 times

Post by Dinoguy1000 »

That sounds like something you would use a macro for. Unfortunately, I have no idea how to make or use macros, but a quick Google search should turn up some tutorials...
Welcome to Xentax!

Rules | Requests | Wiki | Discord

If you run across a post that breaks the rules, please report the post - a mod or admin will handle it from there.
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Post by Mr.Mouse »

Nah, it's in Excel:

You can do this :

http://j-walk.com/ss/excel/usertips/tip011.htm

Or you can do this:
Round to a Chosen Multiple

There is another round function in Excel that will round a number to the multiple we specify. This function is called MROUND. It is not available by default, so you need to go to Tools>Add-ins and check Analysis Toolpak.

=MROUND(22.5,10) will result in a value of 20

=MROUND(22.5,5) will result in a value of 25
In your case, you'd write MROUND(16.277790;0.125)

If you have Excel 2007 this function is in by deafult I believe.

I have attached a test sheet that does this. Check it.
You do not have the required permissions to view the files attached to this post.
Xela
VIP member
VIP member
Posts: 225
Joined: Sun Jul 31, 2005 4:12 am
Been thanked: 1 time

Post by Xela »

Thanks Mr. Mouse and DinoGuy1K,
=MROUND function would do nicely. Very nicely.
Post Reply