#1   Report Post  
GeeB
 
Posts: n/a
Default SUM of Hex?

OK...this is probably a very simple answer, but I can't seem to find it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want to
simply present the SUM of that colum in Hex. I've been unable to get the SUM
function to do this. What am I missing?

  #2   Report Post  
Barb Reinhardt
 
Posts: n/a
Default

You may need a helper column where you convert from HEX to DEC (using
function HEXTODEC) and then sum that column. Convert back to HEX using
DECTOHEX function.

"GeeB" wrote in message
...
OK...this is probably a very simple answer, but I can't seem to find it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want to
simply present the SUM of that colum in Hex. I've been unable to get the

SUM
function to do this. What am I missing?



  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Fri, 8 Jul 2005 08:34:01 -0700, "GeeB"
wrote:

OK...this is probably a very simple answer, but I can't seem to find it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want to
simply present the SUM of that colum in Hex. I've been unable to get the SUM
function to do this. What am I missing?


SUM adds numbers. HEX representations are strings so cannot be added by the
SUM worksheet function.

You could either write a custom VBA user defined function or use a helper
column:

With your data in A1:A5, in the above format, enter a formula

=hex2dec(MID(A1,3,255))

in B1 and drag down to B5.

In some cell, but the formula:

=DEC2HEX(SUM(B1:B5))


--ron
  #4   Report Post  
GeeB
 
Posts: n/a
Default

Thanks for the info...when I use your first example, I get a #NAME? error.

I have the Analysis Toolpak installed and enabled.


"Ron Rosenfeld" wrote:

On Fri, 8 Jul 2005 08:34:01 -0700, "GeeB"
wrote:

OK...this is probably a very simple answer, but I can't seem to find it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want to
simply present the SUM of that colum in Hex. I've been unable to get the SUM
function to do this. What am I missing?


SUM adds numbers. HEX representations are strings so cannot be added by the
SUM worksheet function.

You could either write a custom VBA user defined function or use a helper
column:

With your data in A1:A5, in the above format, enter a formula

=hex2dec(MID(A1,3,255))

in B1 and drag down to B5.

In some cell, but the formula:

=DEC2HEX(SUM(B1:B5))


--ron

  #5   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Fri, 8 Jul 2005 11:53:03 -0700, "GeeB"
wrote:

Thanks for the info...when I use your first example, I get a #NAME? error.

I have the Analysis Toolpak installed and enabled.


Copy and paste the exact formula you are using; and also copy/paste the exact
data it is working on.

Let's see if we can figure this out.


--ron


  #6   Report Post  
GeeB
 
Posts: n/a
Default

Sure, here's the basic column:

A1: 0x20
A2: 0x1
A3: 0x80

A5: =hex2dec(MID,A1,3,255))

After entering the formula, the #NAME? appears in A5

I've also tried removing the '0x' portion of the #'s with the same result.

I'm running Excel 2003

Thanks for your assistance.

Copy and paste the exact formula you are using; and also copy/paste the exact
data it is working on.

Let's see if we can figure this out.


--ron

  #7   Report Post  
GeeB
 
Posts: n/a
Default

I made a typo in my previous post...

This:
A5: =hex2dec(MID,A1,3,255))


Is actually this in my spreadsheet:
A5: =hex2dec(MID(A1,3,255))


Again, just a typo in the post. I used the correct formula in Excel and get
the error as noted.


"GeeB" wrote:

Sure, here's the basic column:

A1: 0x20
A2: 0x1
A3: 0x80

A5: =hex2dec(MID,A1,3,255))

After entering the formula, the #NAME? appears in A5

I've also tried removing the '0x' portion of the #'s with the same result.

I'm running Excel 2003

Thanks for your assistance.

Copy and paste the exact formula you are using; and also copy/paste the exact
data it is working on.

Let's see if we can figure this out.


--ron

  #8   Report Post  
moi
 
Posts: n/a
Default

I have Excel 2000. No =hex2dec() in there, indeed it gives a #NAME error.
For myself I solved this with a simple DLL:
http://www.geocities.com/smplprgrsrc/files/HEX2DEC.zip

Probably not according to all conventions, but it works fine for me.




"GeeB" schreef in bericht
...
OK...this is probably a very simple answer, but I can't seem to find it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want to
simply present the SUM of that colum in Hex. I've been unable to get the
SUM
function to do this. What am I missing?



  #9   Report Post  
GeeB
 
Posts: n/a
Default

The hyperlink is invalid. Are you sure it is correct?

"moi" wrote:

I have Excel 2000. No =hex2dec() in there, indeed it gives a #NAME error.
For myself I solved this with a simple DLL:
http://www.geocities.com/smplprgrsrc/files/HEX2DEC.zip

Probably not according to all conventions, but it works fine for me.




"GeeB" schreef in bericht
...
OK...this is probably a very simple answer, but I can't seem to find it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want to
simply present the SUM of that colum in Hex. I've been unable to get the
SUM
function to do this. What am I missing?




  #10   Report Post  
moi
 
Posts: n/a
Default

Thanks, that was quite stupid.
The link will work now.



"GeeB" schreef in bericht
...
The hyperlink is invalid. Are you sure it is correct?

"moi" wrote:

I have Excel 2000. No =hex2dec() in there, indeed it gives a #NAME error.
For myself I solved this with a simple DLL:
http://www.geocities.com/smplprgrsrc/files/HEX2DEC.zip

Probably not according to all conventions, but it works fine for me.




"GeeB" schreef in bericht
...
OK...this is probably a very simple answer, but I can't seem to find
it...

I have a column of hexidecimal numbers (0x20, 0x40, etc.) that I want
to
simply present the SUM of that colum in Hex. I've been unable to get
the
SUM
function to do this. What am I missing?








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"