Binary to Hexadecimal

Thiyagu8423

New Member
Joined
Aug 21, 2020
Messages
13
Office Version
  1. 2013
Platform
  1. Windows
I have 26byte number in one cell , can I convert it to Hexadecimal using formula in one shot
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
First, I assume that the cell is formatted as Text, otherwise the 104 digits of 26 bytes would try to convert to an exponential number. Next, are you still using Excel 2013? If so, I can't think of a way to get the formula in a single cell (except for a UDF). In Excel 2016, Microsoft added several base conversion functions. And with the array functions, it got even easier.

Consider:

Book1
ABCDEF
1BinaryHexadecimalBinaryHex
211100101011110001110001011101110001110110101000001010101010101000011100011110101010101010101110001110111E578E2EE3B50555438F5555C7700000
300011
4E00102
5E500113
6E5701004
7E57801015
8E578E01106
9E578E201117
10E578E2E10008
11E578E2EE10019
12E578E2EE31010A
13E578E2EE3B1011B
14E578E2EE3B51100C
15E578E2EE3B501101D
16E578E2EE3B5051110E
17E578E2EE3B50551111F
18E578E2EE3B50555
19E578E2EE3B505554
20E578E2EE3B5055543
21E578E2EE3B50555438
22E578E2EE3B50555438F
23E578E2EE3B50555438F5
24E578E2EE3B50555438F55
25E578E2EE3B50555438F555
26E578E2EE3B50555438F5555
27E578E2EE3B50555438F5555C
28E578E2EE3B50555438F5555C7
29E578E2EE3B50555438F5555C77
Sheet5
Cell Formulas
RangeFormula
B2B2=CONCAT(BIN2HEX(MID(A2,SEQUENCE(LEN(A2)/4,,,4),4)))
B4:B29B4=B3&VLOOKUP(MID(A$2,ROWS(A$4:A4)*4-3,4),$E$2:$F$17,2,0)


The B2 formula is a single cell formula, but it requires the newer functions. For 2013, the best I could do was the series of functions in B4:B29, with B29 being the final answer. You could put the intermediate formulas horizontally in hidden columns, and only show the final result. Or if you're willing to use VBA, I could write a UDF (User-Defined Function) that would work in 2013 and only require a single cell.
 
Upvote 0

Forum statistics

Threads
1,223,836
Messages
6,174,921
Members
452,591
Latest member
Zai2809

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top