LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default =RAND produces decimals not whole numbers

I am a teacher making randomised equation sheets for young children in my
school, along with simultaneous answer sheets for teachers to speed up
marking, (plenty of educational websites already do this but I wanted to
customise my own using Excel).

No problem with setting out the equations, which I do by simply putting one
"randomised" cell above another and placing a dummy operation sign, such as
"x", beside the equation. For the simplest equations I use =RAND()*(1-9)+9 to
give cell values between 1 and 9. I'm new to this, so hope I'm right so far!

For the answers the cell references are copied to a second page in the same
worksheet, with a =SUM equation placed underneath. This where the problems
start. For instance 3 x 6 might, (and should, if I value my career!), appear
as 18, but has also come out as 20 and even 21!

I discovered the problem in the cell formatting. While Number Formatting
shows the correct whole number, (3 for example), General Formatting shows
that the number is actually 2.875260427 or 3.154202565. It's different each
time. So, although I am reading whole numbers on screen, Excel is busily
calculating numbers to 9 decimal places then rounding up to 18, 19, 20, or
21, depending on which it has randomly chosen.

I did a quick test typing in numbers manually and, as expected, each whole
number appeared in General Formatting as a whole number, so this is purely a
problem with random numbers which cannot be altered by specifying fewer
decimal places in Number Formatting.

Is there a way I can customise the cells, or =RAND, to reduce the number of
decimals in General Formatting from 9 to zero and just have
honest-to-goodness whole numbers producing whole answers?!
 
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
Is this possible ??? DB Excel Discussion (Misc queries) 12 August 26th 06 12:19 AM
How do I merge 2 cells to 1 when contents are numbers AND retain decimals huruta Excel Discussion (Misc queries) 3 January 28th 06 07:37 PM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
How to convert numbers with apostrophe's (ex. 219'2) to decimals? Kaci Excel Worksheet Functions 2 June 15th 05 03:48 PM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM


All times are GMT +1. The time now is 11:38 AM.

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"