Any way to add hex numbers?

F

Fan924

I am trying to optimize my checksum routine without using a macro.
Using formulas only if possible. I add up a column of hex numbers and
generates a 4 digit hex checksum. To do this, I had to generate a
decimal number in column D and then add column D. I want to remove
column D from the worksheet. Any way to add hex numbers?

checksum=RIGHT(DEC2HEX(SUM(D1:D4098)),4)

C D
--- ---
02 2
1F 31
4E 78
02 2
1F 31
3A 58
02 2
02 2
72 114
12 18
1E 30
53 83
02 2

I tried variations of this which does not work
(SUM(HEX2DEC(C1):HEX2DEC(C4098))
 
F

Fan924

Never mind. I found this in a Macro I did a few years ago and forgot.
It works. Sorry

ActiveCell.FormulaR1C1 = "=RIGHT(DEC2HEX(SUM(R[0]C[-4]:R[4097]C[-4])),
4)"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top