+ Reply to Thread
Results 1 to 2 of 2

Rand () causing Problems.

  1. #1
    JCary
    Guest

    Rand () causing Problems.

    I am having all sorts of problems with my spreadsheet. I fixed some but I
    think the problem lies within the Rand() function.
    I want a spreadsheet (on one page) (what appears to the students) four
    columns of simple arithmetic problems.
    I want to be able to adjust the operation: +-*/. And have the spreadsheet
    calculate the solutions.
    However I also want to be able to set a range of values such as the first
    column using numbers 1-10 the second 1-15 third 1-20 and fouth 1-25.
    However when I use the random integer function and have the spreadsheet
    calculate the solutions it is off on many of the solutions.
    In cell A1 I have the function lets say "+".
    In cell B2 I have the upper limit for the integers
    In cell B3 I have the lower limit for the integers
    In cell B4 I have: =RAND()*(B$2-B$3)+B$3
    In cell K4 I have=B4 (this is the first number in my problem)
    However when I use in cell AH4
    =SUMPRODUCT(($A$1="+")*($K4+$M4)+($A$1="-")*($K4-$M4)+($A$1="X")*($B4*$C4)+IF($M4<>"",($A$1="/")*($K4/$M4),0))
    The solution varies.
    Thanks for your time.

  2. #2
    Biff
    Guest

    Re: Rand () causing Problems.

    Hi!

    Hmmm.....

    Depending on which operator is entered in A1 and if M4 is either empty or 0,
    the results vary, but they are correct.

    ($B4*$C4)

    Is that a typo? All other references are to M4.

    Here's another (shorter) way to write your formula:

    =IF(OR(M4={"",0}),0,CHOOSE(MATCH(A1,{"+","-","x","/"},0),B4+M4,B4-M4,B4*M4,B4/M4))

    Biff

    "JCary" <[email protected]> wrote in message
    news:[email protected]...
    >I am having all sorts of problems with my spreadsheet. I fixed some but I
    > think the problem lies within the Rand() function.
    > I want a spreadsheet (on one page) (what appears to the students) four
    > columns of simple arithmetic problems.
    > I want to be able to adjust the operation: +-*/. And have the spreadsheet
    > calculate the solutions.
    > However I also want to be able to set a range of values such as the first
    > column using numbers 1-10 the second 1-15 third 1-20 and fouth 1-25.
    > However when I use the random integer function and have the spreadsheet
    > calculate the solutions it is off on many of the solutions.
    > In cell A1 I have the function lets say "+".
    > In cell B2 I have the upper limit for the integers
    > In cell B3 I have the lower limit for the integers
    > In cell B4 I have: =RAND()*(B$2-B$3)+B$3
    > In cell K4 I have=B4 (this is the first number in my problem)
    > However when I use in cell AH4
    > =SUMPRODUCT(($A$1="+")*($K4+$M4)+($A$1="-")*($K4-$M4)+($A$1="X")*($B4*$C4)+IF($M4<>"",($A$1="/")*($K4/$M4),0))
    > The solution varies.
    > Thanks for your time.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1