Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Counting Octals.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Counting Octals.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Counting Octals.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Counting Octals.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Counting Octals.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Counting Octals.

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.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Counting Octals.

Joel,

cal with =fromoctal(A1) from worksheet , this part of the code turns up red.


Where do I need to paste the code? In the worksheet or as a separate module?

The values are in Column F and G and the result should be in column H,
measuring the amount of numbers (0 tru 7) between the entry in column F and
the entry in column G. And this for every row, so the result of F1 and G1 are
in H1, F2 and G2 are in H2 etc etc.

any ideas?

Paul

"Joel" wrote:

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.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Counting Octals.

Let use a function with two input parameters. Put the code in a VBA module.

Put in column H1. then copy down column.
=addoctal(F1,G1)


Function addoctal(Target1 as Range, Target2 as Range)
TextNum = Target1.Text
DecNum = 0
Do While Len(TextNum) 0
DecNum = (8 * DecNum) + Val(Left(TextNum, 1))
TextNum = Mid(TextNum, 2)
Loop
addoctal = DecNum

TextNum = Target2.Text
DecNum = 0
Do While Len(TextNum) 0
DecNum = (8 * DecNum) + Val(Left(TextNum, 1))
TextNum = Mid(TextNum, 2)
Loop

addoctal = addoctal + DecNum

End Function


"Paul Tikken" wrote:

Joel,

cal with =fromoctal(A1) from worksheet , this part of the code turns up red.


Where do I need to paste the code? In the worksheet or as a separate module?

The values are in Column F and G and the result should be in column H,
measuring the amount of numbers (0 tru 7) between the entry in column F and
the entry in column G. And this for every row, so the result of F1 and G1 are
in H1, F2 and G2 are in H2 etc etc.

any ideas?

Paul

"Joel" wrote:

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.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Counting Octals.

Joel,

Thanks, I've got it working!!

Cheers,

Paul

"Joel" wrote:

Let use a function with two input parameters. Put the code in a VBA module.

Put in column H1. then copy down column.
=addoctal(F1,G1)


Function addoctal(Target1 as Range, Target2 as Range)
TextNum = Target1.Text
DecNum = 0
Do While Len(TextNum) 0
DecNum = (8 * DecNum) + Val(Left(TextNum, 1))
TextNum = Mid(TextNum, 2)
Loop
addoctal = DecNum

TextNum = Target2.Text
DecNum = 0
Do While Len(TextNum) 0
DecNum = (8 * DecNum) + Val(Left(TextNum, 1))
TextNum = Mid(TextNum, 2)
Loop

addoctal = addoctal + DecNum

End Function


"Paul Tikken" wrote:

Joel,

cal with =fromoctal(A1) from worksheet , this part of the code turns up red.


Where do I need to paste the code? In the worksheet or as a separate module?

The values are in Column F and G and the result should be in column H,
measuring the amount of numbers (0 tru 7) between the entry in column F and
the entry in column G. And this for every row, so the result of F1 and G1 are
in H1, F2 and G2 are in H2 etc etc.

any ideas?

Paul

"Joel" wrote:

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
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
Counting If Neil Pearce Excel Discussion (Misc queries) 1 February 11th 08 03:03 PM
counting function but not double counting duplicates JRD Excel Worksheet Functions 2 November 7th 07 06:43 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Excel Programming 1 June 1st 05 04:10 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM


All times are GMT +1. The time now is 07:32 PM.

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

About Us

"It's about Microsoft Excel"