Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JCary
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array Formula Limits (around 2800 or so) ? Lotus DSUM has no problems with it ! xlguy Excel Discussion (Misc queries) 6 December 15th 05 06:24 PM
Pivot table problems [email protected] Excel Discussion (Misc queries) 1 December 13th 05 02:37 AM
Integrity Problems in PivotTables Roger F S Excel Discussion (Misc queries) 1 December 4th 05 04:14 AM
I'm getting mad - I'm having problems with EXCEL file name length Raffa Excel Discussion (Misc queries) 2 October 3rd 05 07:56 AM
Dynamic charting problems (events) [email protected] Charts and Charting in Excel 4 January 27th 05 09:32 PM


All times are GMT +1. The time now is 04:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"