+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] adding hexadecimal numbers

  1. #1
    Dave
    Guest

    [SOLVED] adding hexadecimal numbers

    Hi,
    As the subject states, how do I add together cells containing hex numbers. I
    tried
    the following...

    A1 contains 0f
    a2 contains 0f
    a3 contains = a1 + a2
    result #VALUE!

    I know that it knows the cells could be hex because if I do =hex2dec(a1) in
    another cell it converts it. Is there anyway in Excel to explicitly set the
    number type of a cell?

    Regards,
    Dave.

  2. #2
    Dave Peterson
    Guest

    Re: adding hexadecimal numbers

    As long as your numbers fit in that =hex2dec() and =dec2hex() ranges:

    =DEC2HEX(HEX2DEC(A1)+HEX2DEC(A2))

    I don't know of anyway of using a custom format to display hex.

    Dave wrote:
    >
    > Hi,
    > As the subject states, how do I add together cells containing hex numbers. I
    > tried
    > the following...
    >
    > A1 contains 0f
    > a2 contains 0f
    > a3 contains = a1 + a2
    > result #VALUE!
    >
    > I know that it knows the cells could be hex because if I do =hex2dec(a1) in
    > another cell it converts it. Is there anyway in Excel to explicitly set the
    > number type of a cell?
    >
    > Regards,
    > Dave.


    --

    Dave Peterson

  3. #3
    Bernard Liengme
    Guest

    Re: adding hexadecimal numbers

    You have nearly answered your own question:
    =DEC2HEX(HEX2DEC(A1)+HEX2DEC(A2))

    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Dave" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > As the subject states, how do I add together cells containing hex numbers.
    > I
    > tried
    > the following...
    >
    > A1 contains 0f
    > a2 contains 0f
    > a3 contains = a1 + a2
    > result #VALUE!
    >
    > I know that it knows the cells could be hex because if I do =hex2dec(a1)
    > in
    > another cell it converts it. Is there anyway in Excel to explicitly set
    > the
    > number type of a cell?
    >
    > Regards,
    > Dave.




  4. #4
    Dave
    Guest

    Re: adding hexadecimal numbers

    Thanks,
    Thats what I did in the end. I just thought that with Excel being a big
    number cruncher it would be a bit more flexible in the way you can use
    numbers of a different base without having to jump through loops.

    Regards,
    Dave.

    "Bernard Liengme" wrote:

    > You have nearly answered your own question:
    > =DEC2HEX(HEX2DEC(A1)+HEX2DEC(A2))
    >
    > --
    > Bernard V Liengme
    > www.stfx.ca/people/bliengme
    > remove caps from email
    >
    > "Dave" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > > As the subject states, how do I add together cells containing hex numbers.
    > > I
    > > tried
    > > the following...
    > >
    > > A1 contains 0f
    > > a2 contains 0f
    > > a3 contains = a1 + a2
    > > result #VALUE!
    > >
    > > I know that it knows the cells could be hex because if I do =hex2dec(a1)
    > > in
    > > another cell it converts it. Is there anyway in Excel to explicitly set
    > > the
    > > number type of a cell?
    > >
    > > Regards,
    > > Dave.

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1