Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Randomise in excel

Posted on 2013-05-25
2
Medium Priority
?
167 Views
Last Modified: 2013-05-30
Hi

I am trying to generate some test data for a customer survey that I am building.

The customer can enter one of the following responses -

Excellent
Very Good
Satisfactory
Very Poor
Unacceptable

I want to generate some data for 1921 rows. I want excel to select any one of those entries at random. At the moment I can only randomize the order or the response and not the selection.

Can anyone help me?
0
Comment
Question by:mr_bungle89
2 Comments
 
LVL 24

Expert Comment

by:Eirman
ID: 39197110
I'm somewhat confused ... What's the difference between "response" and "Selection" ?
0
 
LVL 14

Accepted Solution

by:
Faustulus earned 2000 total points
ID: 39197155
You may like to try this formula:
=LOOKUP(RANDBETWEEN(1,5),{1,2,3,4,5},$A$4:$A$8)

Open in new window

The range A4:A8 holds the five responses. You can move them elsewhere, anywhere in the workbook, and adjust the referenced range in the formula. You can also use a named range. It would make sense to use the same range that holds the list for your drop-down from which the user selects his response. In that case you can enter the formula in the same field the user  can later over-write to enter his own response.
The RANDBETWEEN() function will re-calculate every time the sheet re-calculates. Also, the formula will be lost if the user makes a selection. So, presuming that you have the formula in all of your 1921 cells and the user makes a selection in the first of them, ALL 1921 cells will change. However, the formula will be lost only in the first cell, and that cell won't therefore be able to change again on future re-calculations.
If this behavior isn't acceptable you can Copy/Paste special => Values to replace the formula with hard values.
I hope this will be useful to you.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question