Home |
Search |
Today's Posts |
#22
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
which numbers add up to a specific total | Excel Worksheet Functions | |||
How to obtain a total count of two columns for a specific product | Excel Worksheet Functions | |||
How do i count numbers and letters to find a total count of all | Excel Worksheet Functions | |||
Count and Sum Total occurrances of two specific numbers | Excel Worksheet Functions | |||
How do I add a range of numbers to sum a specific total? | Excel Worksheet Functions |