ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Addition worksheet generator (https://www.excelbanter.com/excel-worksheet-functions/6699-addition-worksheet-generator.html)

Sriram

Addition worksheet generator
 
I thought it would be simple to set-up an addition exercise generator for my
class of young Abacus students. The exercises typically involve adding a
series of numbers (more than two) for a positive result.

The student adds from top to bottom, and should not encounter a negative sum
at any point. To illustrate,
5
-4
-7
8
3


is not acceptable (summing through the third number results in a negative)
but
5
4
-7
8
3

is OK.

I tried to use the RANDBETWEEN() function to generate random numbers for the
problems, but the results are not usable because of this constraint.

I'm hoping for some clever way to ensure that the numbers all line up nicely
so I always get a positive figure at each step of the summation? Negative
numbers do need to be allowed however.

Sriram




LanceB

How about this

in a1

=ROUND(RAND()*10,0)*IF(RAND()0.5,-1,1)

in a2

=IF(SUM($A$1:A1)10,ROUND(RAND()*10,0)*IF(RAND()0 .5,-1,1),ABS(SUM($A$1:A1))+ROUND(RAND()*(10-ABS(SUM($A$1:A1))),0))

drag formula down for as many rows as you want for your sum

Lance


"Sriram" wrote:

I thought it would be simple to set-up an addition exercise generator for my
class of young Abacus students. The exercises typically involve adding a
series of numbers (more than two) for a positive result.

The student adds from top to bottom, and should not encounter a negative sum
at any point. To illustrate,
5
-4
-7
8
3


is not acceptable (summing through the third number results in a negative)
but
5
4
-7
8
3

is OK.

I tried to use the RANDBETWEEN() function to generate random numbers for the
problems, but the results are not usable because of this constraint.

I'm hoping for some clever way to ensure that the numbers all line up nicely
so I always get a positive figure at each step of the summation? Negative
numbers do need to be allowed however.

Sriram





Sriram

That appears to work nicely, except I changed it slightly to restrict the
first number to be positive; one of the rules of the game.

In the meanwhile, I had worked out a slightly different approach which also
fits the need, something like this:
A1 =RANDBETWEEN(1,10)
A2 =RANDBETWEEN(-1*A1,10)
A3 =RANDBETWEEN(-1*(A1+A2),10)

and so on.

"LanceB" wrote in message
...
How about this

in a1

=ROUND(RAND()*10,0)*IF(RAND()0.5,-1,1)

in a2


=IF(SUM($A$1:A1)10,ROUND(RAND()*10,0)*IF(RAND()0 .5,-1,1),ABS(SUM($A$1:A1))
+ROUND(RAND()*(10-ABS(SUM($A$1:A1))),0))

drag formula down for as many rows as you want for your sum





All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com