ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Format Cells for Hexidecimal (custom?) (https://www.excelbanter.com/excel-discussion-misc-queries/227750-format-cells-hexidecimal-custom.html)

Mischief

Format Cells for Hexidecimal (custom?)
 
I have a spreadsheet that requires a user to input a hex value. but the hex
values don't always display and there is no fault checking. (2 issues)
Simple solutions:
1) Have the user place a ' in front of the entry.
2) Use Custom format for cells as "@" without quotes to force text.
Both of these methods prevent 05e3 from converting to 5000 or 5.00E+03 and
preserve the leading zero if the user types it.

But is there be a way to force the hex formating?
What if you want to force the hex value to be 4 digits. How could you force
a part part number with text to be a certain number of characters?
Is there a way to force a cell to have a minimum number of characters with a
custom format? Is there a way to force hex values to be uppercase?

Is there a way to specify a format such as:
xxxx; where x { (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
or perhaps a part number where I and O are not used (to avoid confusion) and
perhaps a binary character.
000aa-00.b; where a { (0123456789ABCDEFGHJKLMNPQRSTUVWXYZ) and b { (0,1).
Examples: 1230X-45.0, 456CG-78.1, 789A5-00.1
Another benefit to specifying a format like this would be to allow automatic
increments for filliing cells. You can create your own numbering system.
789A5-00.1 + 00000-00.1 = 789A5-01.0. OK, perhaps that is taking it a bit to
far.

Back to my question, can custom formats be made for hex?

Luke M

Format Cells for Hexidecimal (custom?)
 
My initial thought is would be to simply pre-format the cell as text, that
way not matter what you input it would not get translated/lost.

For manipulating Hex numbers:
If you haven't already found them, the DEC2HEX and HEX2DEC functions may be
helpful to you.

For instance, if you input "DE" into a cell A2, you could then write:
=DEC2HEX(1+HEX2DEC(A2))
into A3, and then copy down to simulate XL's normal counting method.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Mischief" wrote:

I have a spreadsheet that requires a user to input a hex value. but the hex
values don't always display and there is no fault checking. (2 issues)
Simple solutions:
1) Have the user place a ' in front of the entry.
2) Use Custom format for cells as "@" without quotes to force text.
Both of these methods prevent 05e3 from converting to 5000 or 5.00E+03 and
preserve the leading zero if the user types it.

But is there be a way to force the hex formating?
What if you want to force the hex value to be 4 digits. How could you force
a part part number with text to be a certain number of characters?
Is there a way to force a cell to have a minimum number of characters with a
custom format? Is there a way to force hex values to be uppercase?

Is there a way to specify a format such as:
xxxx; where x { (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
or perhaps a part number where I and O are not used (to avoid confusion) and
perhaps a binary character.
000aa-00.b; where a { (0123456789ABCDEFGHJKLMNPQRSTUVWXYZ) and b { (0,1).
Examples: 1230X-45.0, 456CG-78.1, 789A5-00.1
Another benefit to specifying a format like this would be to allow automatic
increments for filliing cells. You can create your own numbering system.
789A5-00.1 + 00000-00.1 = 789A5-01.0. OK, perhaps that is taking it a bit to
far.

Back to my question, can custom formats be made for hex?



All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com