Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using a sheet that has Octal values in it, so only 0 tru 7 are used as numbers. A value in column F in entered in Octals e.g. 00200, another value is entered in column G e.g. 00377. Now I would like the total amount of numbers to show up in Column H, so in this case 128. There are a couple of snacks, the following numbers cannot be used and therefore should not be counted in the total amount; 77 and 176 and 177 and 77777 (77777 is also the last number in the sequence. Can anybode help? Paul. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul,
Still doing Octal I see. I think we need some clarification 200+377 octal=577 octal 200+377 octal = 383 decimal As you will note, neither are the 128 you want (128 oct = decimal 200) DEC2OCT and OCT2DEC are something to look at Mike "Paul Tikken" wrote: Hi, I'm using a sheet that has Octal values in it, so only 0 tru 7 are used as numbers. A value in column F in entered in Octals e.g. 00200, another value is entered in column G e.g. 00377. Now I would like the total amount of numbers to show up in Column H, so in this case 128. There are a couple of snacks, the following numbers cannot be used and therefore should not be counted in the total amount; 77 and 176 and 177 and 77777 (77777 is also the last number in the sequence. Can anybode help? Paul. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike,
Yes still going strong on octals. My bad, let me clearify; The 200 and 377 I spoke about is an allocated range, meaning that the number 200 tru 277 and 300 tru 377 can be used, but only the numbers 0 tru 7 (so that's why I spoke about octals) if you add these up you'll get 128 (64 for 200 tru 277 and 64 for 300 tru 377) Any ideas? Paul "Mike H" wrote: Paul, Still doing Octal I see. I think we need some clarification 200+377 octal=577 octal 200+377 octal = 383 decimal As you will note, neither are the 128 you want (128 oct = decimal 200) DEC2OCT and OCT2DEC are something to look at Mike "Paul Tikken" wrote: Hi, I'm using a sheet that has Octal values in it, so only 0 tru 7 are used as numbers. A value in column F in entered in Octals e.g. 00200, another value is entered in column G e.g. 00377. Now I would like the total amount of numbers to show up in Column H, so in this case 128. There are a couple of snacks, the following numbers cannot be used and therefore should not be counted in the total amount; 77 and 176 and 177 and 77777 (77777 is also the last number in the sequence. Can anybode help? Paul. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub fromoctal()
TextNum = Trim(Range("A1").Text) OctNum = 0 Do While Len(TextNum) 0 OctNum = (8 * OctNum) + Val(Left(TextNum, 1)) TextNum = Mid(TextNum, 2) Loop End Sub "Paul Tikken" wrote: Mike, Yes still going strong on octals. My bad, let me clearify; The 200 and 377 I spoke about is an allocated range, meaning that the number 200 tru 277 and 300 tru 377 can be used, but only the numbers 0 tru 7 (so that's why I spoke about octals) if you add these up you'll get 128 (64 for 200 tru 277 and 64 for 300 tru 377) Any ideas? Paul "Mike H" wrote: Paul, Still doing Octal I see. I think we need some clarification 200+377 octal=577 octal 200+377 octal = 383 decimal As you will note, neither are the 128 you want (128 oct = decimal 200) DEC2OCT and OCT2DEC are something to look at Mike "Paul Tikken" wrote: Hi, I'm using a sheet that has Octal values in it, so only 0 tru 7 are used as numbers. A value in column F in entered in Octals e.g. 00200, another value is entered in column G e.g. 00377. Now I would like the total amount of numbers to show up in Column H, so in this case 128. There are a couple of snacks, the following numbers cannot be used and therefore should not be counted in the total amount; 77 and 176 and 177 and 77777 (77777 is also the last number in the sequence. Can anybode help? Paul. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Joel,
I couldn't get it to work. Do I need to tweak it anywhere? Paul "Joel" wrote: Sub fromoctal() TextNum = Trim(Range("A1").Text) OctNum = 0 Do While Len(TextNum) 0 OctNum = (8 * OctNum) + Val(Left(TextNum, 1)) TextNum = Mid(TextNum, 2) Loop End Sub "Paul Tikken" wrote: Mike, Yes still going strong on octals. My bad, let me clearify; The 200 and 377 I spoke about is an allocated range, meaning that the number 200 tru 277 and 300 tru 377 can be used, but only the numbers 0 tru 7 (so that's why I spoke about octals) if you add these up you'll get 128 (64 for 200 tru 277 and 64 for 300 tru 377) Any ideas? Paul "Mike H" wrote: Paul, Still doing Octal I see. I think we need some clarification 200+377 octal=577 octal 200+377 octal = 383 decimal As you will note, neither are the 128 you want (128 oct = decimal 200) DEC2OCT and OCT2DEC are something to look at Mike "Paul Tikken" wrote: Hi, I'm using a sheet that has Octal values in it, so only 0 tru 7 are used as numbers. A value in column F in entered in Octals e.g. 00200, another value is entered in column G e.g. 00377. Now I would like the total amount of numbers to show up in Column H, so in this case 128. There are a couple of snacks, the following numbers cannot be used and therefore should not be counted in the total amount; 77 and 176 and 177 and 77777 (77777 is also the last number in the sequence. Can anybode help? Paul. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code just performs a conversion from octal to decimal. I used as ax
example getting data from cell A1 (TextNum = Trim(Range("A1").Text). the code could be writen as a function like the new code below cal with =fromoctal(A1) from worksheet Function fromoctal(Target as Range) TextNum = Target.Text DecNum = 0 Do While Len(TextNum) 0 DecNum = (8 * DecNum) + Val(Left(TextNum, 1)) TextNum = Mid(TextNum, 2) Loop fromoctal = DecNum End Function "Paul Tikken" wrote: Joel, I couldn't get it to work. Do I need to tweak it anywhere? Paul "Joel" wrote: Sub fromoctal() TextNum = Trim(Range("A1").Text) OctNum = 0 Do While Len(TextNum) 0 OctNum = (8 * OctNum) + Val(Left(TextNum, 1)) TextNum = Mid(TextNum, 2) Loop End Sub "Paul Tikken" wrote: Mike, Yes still going strong on octals. My bad, let me clearify; The 200 and 377 I spoke about is an allocated range, meaning that the number 200 tru 277 and 300 tru 377 can be used, but only the numbers 0 tru 7 (so that's why I spoke about octals) if you add these up you'll get 128 (64 for 200 tru 277 and 64 for 300 tru 377) Any ideas? Paul "Mike H" wrote: Paul, Still doing Octal I see. I think we need some clarification 200+377 octal=577 octal 200+377 octal = 383 decimal As you will note, neither are the 128 you want (128 oct = decimal 200) DEC2OCT and OCT2DEC are something to look at Mike "Paul Tikken" wrote: Hi, I'm using a sheet that has Octal values in it, so only 0 tru 7 are used as numbers. A value in column F in entered in Octals e.g. 00200, another value is entered in column G e.g. 00377. Now I would like the total amount of numbers to show up in Column H, so in this case 128. There are a couple of snacks, the following numbers cannot be used and therefore should not be counted in the total amount; 77 and 176 and 177 and 77777 (77777 is also the last number in the sequence. Can anybode help? Paul. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting If | Excel Discussion (Misc queries) | |||
counting function but not double counting duplicates | Excel Worksheet Functions | |||
Counting rows, then counting values. | Excel Discussion (Misc queries) | |||
Counting Rows Then Counting Values in Columns | Excel Programming | |||
Counting names in a column but counting duplicate names once | Excel Discussion (Misc queries) |