Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Excel 2010 and performing a hextodec conversion with text appended to end.

If I have a HEX value of 00B60000 that is located in cell D3 and apply the formula =SUM(((HEX2DEC(D3)*32)/1024)/1024)&" MB" I get the expected result of 364 MB.

If I have a HEX value of 00B5995A that is located in cell F3 and apply the formula =SUM(((HEX2DEC(F3)*32)/1024)/1024)&" MB" I get the result 363.198059082031 MB which is mathematically correct, but I do not want all the decimal places.

I have tried all the default formatting options to the cell, including without decimal places, and the result is the same. Additionally, I have tried to clear contents of the cell and have copied the format from the cell that works correctly to the one that does not work correctly to no avail.

share|improve this question

1 Answer 1

You can use the ROUND function, with 0 decimal places:

=ROUND(((HEX2DEC(D3)*32)/1024)/1024,0) & " MB"

Another solution, would be to keep the results stored as numbers, and show with "MB", using this formula:

=(((HEX2DEC(E3)*32)/1024)/1024)

and applying this custom formatting: 0 "MB"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.