View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Bryan Bryan is offline
external usenet poster
 
Posts: 114
Default Incrementing a hexidecimal column

Perfect Dave!! Thanks!

"Dave Peterson" wrote:

I'd use some variation of this:

="00-00-54-00-"&RIGHT("0"&DEC2HEX(HEX2DEC("4b")+INT((ROW()-1)/256)),2) &"-"
&RIGHT("0"&DEC2HEX(MOD(ROW(),256)-1),2)



Bryan wrote:

Dave,
Thanks!! Your answer works perfectly. I am starting with 00-00-54-00-40-00
so I made a change by replacing the "0" with a "4". Just curious for the
future, though... What if I had to start with 4B instead of 40? (I have
these numbers arbitrarily assigned to me.) I get them 1000 at a time.

"Dave Peterson" wrote:

What string are you going to start with?
What row gets that string?
How far you gonna go?

I'm assuming that you're starting in row 1 and you're starting with:
xx-yy-zz-00-00

Put this in A1 and drag down:
="xx-yy-zz-"&RIGHT("0"&DEC2HEX(INT((ROW()-1)/256)),2) &"-"
&RIGHT("0"&DEC2HEX(MOD(ROW(),256)-1),2)

(Change xx-yy-zz to whatever you want to start with.)


Bryan wrote:

It works all the way to:
00-00-54-00-3A-FF
But then it goes to:
00-00-54-00-3A-100
It needs to go to 3B-00

How can I keep it at 2 digits?

"Dave Peterson" wrote:

Maybe you could use a formula and drag that down.

I put this in A1:
="00-00-54-00-3A-"&DEC2HEX(HEX2DEC(66)+ROW())
And got:
00-00-54-00-3A-67
00-00-54-00-3A-68
00-00-54-00-3A-69
00-00-54-00-3A-6A
00-00-54-00-3A-6B
.....

Depending on your starting row (and your ending quintet), you may have to fiddle
with that expression.

Bryan wrote:

"Bryan" wrote:

Hey all, I have a list of hex numbers I need to increment. The dec2hex
method won't work here as my numbers look like the following:
00-00-54-00-3A-67
I have seen this in a column with a one thousand incremented in the list.
There has to be a way to do it, but I have no clue! Any ideas? Thanks for
your help!

Let me be slightly more specific:

00-00-54-00-3A-93
00-00-54-00-3A-94
00-00-54-00-3A-95
00-00-54-00-3A-96
00-00-54-00-3A-97
00-00-54-00-3A-98
00-00-54-00-3A-99
00-00-54-00-3A-9A
00-00-54-00-3A-9B
00-00-54-00-3A-9C
00-00-54-00-3A-9D
00-00-54-00-3A-9E
00-00-54-00-3A-9F
00-00-54-00-3A-A0
00-00-54-00-3A-A1
00-00-54-00-3A-A2
00-00-54-00-3A-A3
00-00-54-00-3A-A4
00-00-54-00-3A-A5
00-00-54-00-3A-A6
00-00-54-00-3A-A7
00-00-54-00-3A-A8
00-00-54-00-3A-A9
00-00-54-00-3A-AA

That is what I mean by increment. Thanks!

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson