LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #22   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Count Specific Total Numbers from a Set

Thanks for the reply Dana,

I will have a play around over the next week with your suggestions.
What does the "&" mean in "n(P) = 1&" please.
Also, it would be appreciated if you could just explain what the
variables "R", "n", "NPrime", "PrimeQ" & "S" actually do please. It
appears that the variable "R" means one thing at the beginning of the
code and something else further down.

Thanks in Advance.
All the Best.
Paul

On Nov 4, 12:42 am, "Dana DeLouis" wrote:
Instead of Select Case, and looping 49 times, I suppose we could loop 15
times.
As you can see, there are many different ideas one can use.
The idea here is that the Array is initialized with zero anyway, and we are
just setting a few of them to 1.

Dim P As Variant
' Do Once Here
For Each P In Array(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47)
n(P) = 1&
Next P

I'm not sure of your second question, as I se eyou already have a solution
to your Odd/Even query.
--
Dana DeLouis

"Paul Black" wrote in message

oups.com...



I would like to do two more tests, mainly count the number of Odd &
Even numbers, but that involves two scenarios, one for Odd & the other
for Even. The results should be as follows :-


0 Odd + 6 Even = 134,596
1 Odd + 5 Even = 1,062,600
2 Odd + 4 Even = 3,187,800
3 Odd + 3 Even = 4,655,200
4 Odd + 2 Even = 3,491,400
5 Odd + 1 Even = 1,275,120
6 Odd + 0 Even = 177,100
Totals = 1,3983,816


' Do Once Here
For R = 1 To 49
Select Case R
Case 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47
n(R) = 1
Case Else
n(R) = 0
End Select
Next R- Hide quoted text -


- Show quoted text -



 
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
which numbers add up to a specific total esilverb Excel Worksheet Functions 2 January 27th 09 09:19 PM
How to obtain a total count of two columns for a specific product Jennifer Excel Worksheet Functions 4 April 13th 08 03:51 PM
How do i count numbers and letters to find a total count of all Linda Excel Worksheet Functions 4 November 10th 05 04:51 PM
Count and Sum Total occurrances of two specific numbers Sam via OfficeKB.com Excel Worksheet Functions 10 March 29th 05 08:13 PM
How do I add a range of numbers to sum a specific total? SJoshi Excel Worksheet Functions 3 February 15th 05 01:16 PM


All times are GMT +1. The time now is 06:55 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"