Excel for Marketing Managers

(Dana P.) #1
Math Facts Game

Math Facts
Game


G19, you will use an OR function nested in an IF function. This is also the
place where you can decide the range of numbers to use with your students.

For younger students, you may want to limit the numbers to between 1 and


  1. For middle school students who are working on positive and negative
    numbers, the range could be from –10 to +10. For now, you will use the
    numbers 1 to 9. Click on A1 and type in this formula:
    =IF(OR($G$19=”?”,$G$19=”show”),A1,RANDBETWEEN(1,9))


Very simply, this formula tells Excel to generate a random number in cell
A1 unless G19 contains the “?” or “show”, in which case to display the last
number that was randomly generated.

The dollar signs ($) in the G19 cell reference make it an absolute reference,
which means the cell reference will not change if you copy the formula.
Normally when you copy a formula to another cell, the cell references
change relative to the original cell. For more information, see pages 47-48.

Note:
The function you will use to generate the random numbers, RANDBETWEEN, is
not a standard Excel function, but is, instead, part of something called the Analy-
sis ToolPak. To have this and other functions available, you need to do the follow-
ing: From the Tools menu, select Add-Ins. When the dialog box opens, click on the
boxes next to Analysis ToolPak and Analysis ToolPak –VBA. Click OK to exit.
See page 53, Creating the Solution for more details.

Note:
Notice that this formula contains a reference to the cell that contains it (A1). This
is referred to as a circular reference, and is usually not done. However, putting the
check mark in the box next to the word Iteration allows this to happen without an
error message.
Free download pdf