Problem selecting samples

A

a007dan

I have a column w/ a #, there are about 1,000 columns, the #s range fro
1 - 15788. Lets say we are working in column A & we have the followin
data.

A1 - 10000
A2 - 8000
A3 - 5000
A4 - 5000
A5 - 4000
A6 - 4000

The formula/code would look @ a # & see that it is less than a sampl
size I select (x), lets say x is 20,000. Formula looks @ A1 & say
cell is less than x, it then evaluates the next cell & takes th
previous (since it was less than x) & sums it (10,000 + 8,000). Thi
total is less than x. So it looks @ A3. (10,000 + 8,000 + 5,000
23,000). This is greater than x. Since it is greater than x, th
formula will * the cell or highlight or make it known that it has bee
selected by any means. The formula must then take 23,000 - x = 3,000.
3,000 would be carried over to the next cell & the process continues.
3,000 + A4 5,000 = 8,000. 8,000 + 4,000 = 12,000. 12,000 + 4,000
16,000. This will continue until it = or is greater than 20,000. An
help would be of great assistance. The purpose of this is to selec
sample sizes every so many numbers. Any questions or more detail, jus
drop me a msg. Thanks again.

Dan
(e-mail address removed)
 
F

Frank Kabel

Hi Dan
see you response in Excel.programming. It may help you
Frank
P.S.: please don't multipost, as it scatters your answers
 
R

Roger Govier

Hi

Mark the range of data.
Whislt cursor in in cell A1, Format=>Conditional Formatting=>Choose drop
down for Formula Is
In white pane type
=MOD(SUM(A$1:A1),20000)<A1
Choose Format of Red Font or whatever you want to highlight the cells
 
J

Jonathan Rynd

A1 - 10000
A2 - 8000
A3 - 5000
A4 - 5000
A5 - 4000
A6 - 4000

The formula/code would look @ a # & see that it is less than a sample
size I select (x), lets say x is 20,000. Formula looks @ A1 & says
cell is less than x, it then evaluates the next cell & takes the
previous (since it was less than x) & sums it (10,000 + 8,000). This
total is less than x. So it looks @ A3. (10,000 + 8,000 + 5,000 =
23,000). This is greater than x. Since it is greater than x, the
formula will * the cell or highlight or make it known that it has been
selected by any means. The formula must then take 23,000 - x = 3,000.
3,000 would be carried over to the next cell & the process continues.
3,000 + A4 5,000 = 8,000. 8,000 + 4,000 = 12,000. 12,000 + 4,000 =
16,000. This will continue until it = or is greater than 20,000.

Can you guarantee that all numbers in the column will be below x (20000)?
If so this will work.

Select from cell A2 to the bottom of column A. Choose Format/Conditional
Formatting.

Under Condition 1, change "Cell Value Is" to "Formula Is". In the text
box to the right, enter
=MOD(SUM(A$1:A1),20000)>MOD(SUM(A$1:A2),20000)

Then click the Format button, and choose font or border or patterns for
how you would like to highlight the cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top