Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Function to select random values from a list.

Hello

I have been fiddling about trying to construct a fairly simple spreadsheet -
but have so far been unable to find an elegant function to carry out a fairly
simple task.

Basically, I am trying to build a "Flash Card" type worksheet for maths
problems (multiplication, addition, subtraction etc.). The idea is that the
spreadsheet will create random maths problems (e.g. 4 x 7, 6 x 8 etc.) This
is meant to be some fun for my daughter as she practices her times tables.

The complication / refinement that I want to add is that I want to be able
to identify which times tables ( 1 - 12) are to be included in the test (for
instance, we have not done the 7 and 8 times tables yet and so I do not want
to include these tables in the list of randomly generated questions yet). So
far I have just listed the digits 1 - 12 is separate rows and put a "Y"
character in the adjacent box next to each digit to indicate whether I want
that number included in the list of values to used to generate questions -
i.e. to create a shortlist.

The problem is - how do I create a function that randomly selects from this
shortlist of values?

I tried using the CHOOSE function, but to no joy?

Any thoughts anyone?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Function to select random values from a list.

Let us say you have the numbers 1-12 in cells A1:A12. Let us say in
B1:B12 you tick with "y" those numbers that you have already used. The
following formula will produce a random number from those *unticked*
(without a "y" next to them).

=INDEX(SMALL(IF($B$1:$B$12<"y",ROW($A$1:$A$12)),R OW($A$1:$A$12)),INT(RAND()*(12-COUNTIF($B$1:$B$12,"y")))+1)

This formula needs to be array-entered, use Ctrl+Shift+Enter to enter
it.

If we call the above formula _form_, you can now build the bigger
formula:

=_form_ & " x " & _form_

to produce a problem to be solved by daughter. Every time you press F9
a new combination will come up.

HTH
Kostis Vezerides


Peter Barrett wrote:
Hello

I have been fiddling about trying to construct a fairly simple spreadsheet -
but have so far been unable to find an elegant function to carry out a fairly
simple task.

Basically, I am trying to build a "Flash Card" type worksheet for maths
problems (multiplication, addition, subtraction etc.). The idea is that the
spreadsheet will create random maths problems (e.g. 4 x 7, 6 x 8 etc.) This
is meant to be some fun for my daughter as she practices her times tables.

The complication / refinement that I want to add is that I want to be able
to identify which times tables ( 1 - 12) are to be included in the test (for
instance, we have not done the 7 and 8 times tables yet and so I do not want
to include these tables in the list of randomly generated questions yet). So
far I have just listed the digits 1 - 12 is separate rows and put a "Y"
character in the adjacent box next to each digit to indicate whether I want
that number included in the list of values to used to generate questions -
i.e. to create a shortlist.

The problem is - how do I create a function that randomly selects from this
shortlist of values?

I tried using the CHOOSE function, but to no joy?

Any thoughts anyone?

Thanks in advance.


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
Using Match function with duplicate values in an array Richard Excel Worksheet Functions 3 April 22nd 23 07:45 PM
auto updating list Larry Excel Worksheet Functions 8 July 27th 06 01:59 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Keeping a cell value constant trhoughout a list of values borikua05 Excel Worksheet Functions 2 December 3rd 05 03:03 PM
VLOOKUP? Need to have value returned when select from drop-down list Budamon Excel Worksheet Functions 2 November 13th 05 09:05 PM


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

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

About Us

"It's about Microsoft Excel"