Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4113672
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:21:20+00:00 2026-05-20T22:21:20+00:00

I must admit I don’t remember much about HEX and so on from school

  • 0

I must admit I don’t remember much about HEX and so on from school (25 years ago). In any case, I have some values in decimal format which I need to convert into HEX. I am using Excel but I could write a function in VBA if necessary (or do it by code in VB.NET).

I already know how the HEX-result should look like (another source) but I need to use Excel to get this result exactly. The source of decimal input and also the result of the (right) HEX result is from a Linux-system if that is important to know.

Positive numbers seem to be converted correctly while negative numbers give me an headache in the sense that Excel adds in the beinning of the HEX two additional letters (two FF) compared to result I want.

Example:
Decimal input: -524288

Correct HEX-output I must obtain: FFF80000

Using formula in Excel I get: FFFFF80000
(I get 2 FF extra in the beginning of the HEX-output)

Another example:

Decimal Input: -29446758

should be FE3EAD9A

but in Excel I get FFFE3EAD9A

It seems like I always get 2 extra FF in the HEX-output.

Can someone explain (in an easy way) why I get the 2 extra FF and if I can safely remove them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:21:21+00:00Added an answer on May 20, 2026 at 10:21 pm

    In Excel, =DEC2HEX by default returns 10 characters.

    If you want to get just 8, as your question suggest use:

    =DEC2HEX(A1,8)
    

    Nevertheless, unless you have a compatibility issue, you may left the default numbers. Remember that the “F” char acts for negative numbers as a padding char (the same way “0” is for positive numbers).

    Edit

    The above fails for negatives, as you stated in your comment.

    The following works:

    =RIGHT(DEC2HEX(A1),8)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I must admit, I don't know much about JavaScript that is why my question
I must admit that I never understood what are the streams are all about-
Accepting the possibility of extreme ridicule, I must admit that I really miss sun
This must be a classic .NET question for anyone migrating from Java. .NET does
I must be overlooking something simple. I'm setting a variable from a query result
I must admit that I am incredibly jealous of those developers who happen to
I must admit, this is my first post on this site, so I apologise
I must admit, that usually I haven't bothered switching between the Debug and Release
first i must admit that i'm not very familiar with sql server's recursive CTE's
I've not used Zombies before, and must admit I'm not that sure what it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.