Practice Math Problems

G

Guest

Hello,

I'm guessing this should be a relatively easy problem, but I can't figure it
out.

I want to make a sheet of practice math problems for 2nd graders. I've got
the addition sheet figured out:
column x
row 1 =randbetween(1,10)
row 2 =randbetween(1,10)

and an '+ in the cell: (row 2, column x-1)

The subtraction page is the trigger for my question. I would like the same
randomized numbers, but don't want to have the kids (2nd graders!) deal with
negative numbers. Is there a way to get Excel to check the row above and set
the upperbound of the "randbetween" to that number? Would that create an
endless 'do loop' in Excel?

Many thanks,
M John
 
G

Guest

Just use this in place of your other random code
Randomize
iNumber = Int((10 - 1 + 1) * Rnd + 1)

i number will be a random number between 1 and 10, 10 is the upperbound and
both 1's are the lower
 
J

Jim Cone

The following code fills in 5 random numbers between Zero and Ten in row 5 and 6.
If any number in row 6 is larger than the number above it then the two
numbers are switched.
The Analysis ToolPak in "Tools | Add-ins" must be checkmarked.
'---
Sub PositiveAnswersOnlyWhenSubtracting()
Dim dblTemp As Double
Dim rCell As Range
Range("B5:F6").Formula = "=RandBetween(0,10)"
Range("B5:F6").Value = Range("B5:F6").Value
For Each rCell In Range("B6:F6")
If rCell.Value > rCell(0, 1).Value Then
dblTemp = rCell.Value
rCell.Value = rCell(0, 1).Value
rCell(0, 1).Value = dblTemp
End If
Next
Set rCell = Nothing
End Sub
---

You may want to try out my free "Math Practice" workbook available upon
direct request to those who provide a name and location.
(e-mail address removed) (remove the XXX)

It has two difficulty levels, but both of those are more difficult than the level you specify.
It keeps a record of the time / correct answers and provides a chart showing those.
It has separate, random exercises for Adding, Subtracting, Multiplying, Dividing and
Fractions.
'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"M John" <[email protected]>
wrote in message
Hello,

I'm guessing this should be a relatively easy problem, but I can't figure it
out.

I want to make a sheet of practice math problems for 2nd graders. I've got
the addition sheet figured out:
column x
row 1 =randbetween(1,10)
row 2 =randbetween(1,10)

and an '+ in the cell: (row 2, column x-1)

The subtraction page is the trigger for my question. I would like the same
randomized numbers, but don't want to have the kids (2nd graders!) deal with
negative numbers. Is there a way to get Excel to check the row above and set
the upperbound of the "randbetween" to that number? Would that create an
endless 'do loop' in Excel?

Many thanks,
M John
 

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