Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default Help needed on generating sequences

Hi all,
in a excel sheet i want to generate the following sequences for some
array of numbers let us say starting from 0 and going to N-1 bits, the
sequence is from the Hamming Code. For clarity reasons i want to put a
formula in excel that can show me which bit is to be checked as
follows:

Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.
(1,3,5,7,9,11,13,15,...)
Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.
(2,3,6,7,10,11,14,15,...)
Position 4: check 4 bits, skip 4 bits, etc.
(4,5,6,7,12,13,14,15,20,21,22,23,...)
Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc.
(8-15,24-31,40-47,...)
Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits,
etc. (16-31,48-63,80-95,...)
Position 32: check 32 bits, skip 32 bits, etc.
(32-63,96-127,160-191,...)etc.

how can i generate these sequences? using the position
(1,2,4,8,16....) and an array from 0 - N-1, I tried with MOD but i
think i messed it up.
Any help would be appreciated and thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Help needed on generating sequences

Totti,

I'm not sure how you want your information, or how you plan to use it, but, for example, put 1 2 3 4
..... N (bit numbers) down column A, starting in A2.
Then in row 1, starting in B, put 1, 2, 4, 8, 16, 32, etc.

In cell B2, use the formula

=MOD(INT($A2/B$1),2)

and copy to match your column headers in row 1, and row labels in column A.

Then the resulting table, 1s mean check, 0 means skip...

HTH,
Bernie
MS Excel MVP


"Totti" wrote in message
...
Hi all,
in a excel sheet i want to generate the following sequences for some
array of numbers let us say starting from 0 and going to N-1 bits, the
sequence is from the Hamming Code. For clarity reasons i want to put a
formula in excel that can show me which bit is to be checked as
follows:

Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.
(1,3,5,7,9,11,13,15,...)
Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.
(2,3,6,7,10,11,14,15,...)
Position 4: check 4 bits, skip 4 bits, etc.
(4,5,6,7,12,13,14,15,20,21,22,23,...)
Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc.
(8-15,24-31,40-47,...)
Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits,
etc. (16-31,48-63,80-95,...)
Position 32: check 32 bits, skip 32 bits, etc.
(32-63,96-127,160-191,...)etc.

how can i generate these sequences? using the position
(1,2,4,8,16....) and an array from 0 - N-1, I tried with MOD but i
think i messed it up.
Any help would be appreciated and thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Help needed on generating sequences

And if you want it in VBA, then the logic would be

Sub test()
Dim Position As Variant
Dim iBit As Integer
Dim i As Integer
Dim Check As String

Position = Array(1, 2, 4, 8, 16, 32)
Check = ""

For i = LBound(Position) To UBound(Position)
For iBit = 1 To 63
If iBit \ Position(i) Mod 2 = 1 Then
Check = Check & "1"
Else
Check = Check & "0"
End If
Next iBit
Check = Check & vbCrLf
Next i

MsgBox Check

End Sub
--
HTH,
Bernie
MS Excel MVP


"Totti" wrote in message
...
Hi all,
in a excel sheet i want to generate the following sequences for some
array of numbers let us say starting from 0 and going to N-1 bits, the
sequence is from the Hamming Code. For clarity reasons i want to put a
formula in excel that can show me which bit is to be checked as
follows:

Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.
(1,3,5,7,9,11,13,15,...)
Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.
(2,3,6,7,10,11,14,15,...)
Position 4: check 4 bits, skip 4 bits, etc.
(4,5,6,7,12,13,14,15,20,21,22,23,...)
Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc.
(8-15,24-31,40-47,...)
Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits,
etc. (16-31,48-63,80-95,...)
Position 32: check 32 bits, skip 32 bits, etc.
(32-63,96-127,160-191,...)etc.

how can i generate these sequences? using the position
(1,2,4,8,16....) and an array from 0 - N-1, I tried with MOD but i
think i messed it up.
Any help would be appreciated and thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default Help needed on generating sequences

Thank you both, i tried excel formulas it works terrific, then the VBA
as well for more practice and its just fine, Thanks again.
Sincerely, Totti
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricted value sequences in rows yukon_phil Excel Worksheet Functions 11 July 18th 06 10:02 PM
Save as: sequences? Ray Excel Discussion (Misc queries) 0 July 11th 06 03:29 PM
Add sequences of positive then negative numbers judoist Excel Discussion (Misc queries) 6 November 26th 05 05:51 AM
multiple hits in random sequences bill gras Excel Worksheet Functions 2 November 4th 05 09:03 AM
paste sequences of different lengths Catherine Excel Worksheet Functions 2 March 10th 05 02:15 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"