Random Question Generator

Joda

New Member
Joined
May 20, 2010
Messages
2
Hi, after a bit of help, what i am trying to do is design a random question generator for somethign i am doing at work, has to be done within access or excel. This is what i am trying to achieve..

100 Questions, broken down into 5 categories. and it will lets say choose 2 random questions from each section, to make a small exam.

Anyone available to help as have been scratching my head, have workd out how to create a whole random number, and also messed about with LOOKUP and VLOOKUP but cant seem to get that working properly, let alone figured out how to ensure it doesnt pick the same question twice in the same run.

anyone help :x


thanking you in advance
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
To generate a random number you can use this function:
=Int(Rand() * (<max number> - <min number> + 1)) + <min number>
where <min number> and <max number> are min and max value

Then, to get data from a random row, you can use =index(matrix, row, column).
Regards,

Antonio
 
Upvote 0
Not sure if you want this to be done with a normal function or by a macro but these links should answer your first question:

http://www.ozgrid.com/Excel/excel-random-pick.htm (= Excel)
http://www.techonthenet.com/excel/formulas/rnd.php (= VBA)

Making sure the random numbers are not the same is quite easy in VBA but how to make sure it won't happen in Excel is a bit trickier. I'd try to solve it with by placing the "normal" RANDBETWEEN function in the first cell and then putting the same function twice in an IF function for the second cell (The logic being "if the functions return same values then try again").

I tried this with

=IF(RANDBETWEEN(1,2)=A1,RANDBETWEEN(1,2),RANDBETWEEN(1,2))

several times and never got the same values so it seems to work.
 
Upvote 0

Forum statistics

Threads
1,214,529
Messages
6,120,070
Members
448,943
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top