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 Can excel pick a random cell from a column?

I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat. I thought I did this ions ago but maybe it was a dream???
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Can excel pick a random cell from a column?

Try something like this:

Put this table of values in A1:C6
198 208 2.0
209 219 2.5
220 229 3.0
230 240 3.5
241 247 4.0
248 258 4.5

Next....
put this formula in F1
=VLOOKUP(E1,$A$1:$C$6,3,1)
(it will initially display #N/A)

Last...enter a number in E1...The formula in F1 will assign it a value.

Example:
E1: 215
F1: displays 2.5

Is that something you can work with?
Post back with any questions.
***********
Regards,
Ron

XL2002, WinXP


"Helene deChappe" wrote:

I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat. I thought I did this ions ago but maybe it was a dream???

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Can excel pick a random cell from a column?

YIKES! That post has NOTHING to do with your issue. It was meant for another
thread.

I apologize for the mispost.
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Try something like this:

Put this table of values in A1:C6
198 208 2.0
209 219 2.5
220 229 3.0
230 240 3.5
241 247 4.0
248 258 4.5

Next....
put this formula in F1
=VLOOKUP(E1,$A$1:$C$6,3,1)
(it will initially display #N/A)

Last...enter a number in E1...The formula in F1 will assign it a value.

Example:
E1: 215
F1: displays 2.5

Is that something you can work with?
Post back with any questions.
***********
Regards,
Ron

XL2002, WinXP


"Helene deChappe" wrote:

I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat. I thought I did this ions ago but maybe it was a dream???

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 252
Default Can excel pick a random cell from a column?

=INDIRECT("A"&INT(RAND()*7)+1)

replace A with the column containing the list of names, and replace 7 with
the number of names in the list.

Hit F9 to get a new name.

"Helene deChappe" wrote:

I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat. I thought I did this ions ago but maybe it was a dream???

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default Can excel pick a random cell from a column?

Helene deChappe wrote:
I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat.


Try one of the following, depending on whether the names are in a
column (first one) or in a row (second one):

=offset(B3,10*rand(),0)

=offset(B3,0,10*rand())

Replace "B3" with the reference to the cell with the first name.
Replace "10" with the number of names -- or use count(B3:B12), where
"B3:B12" is the range that contains all names.

Note that if you use F9 to select more than one name (or if you put the
formula in multiple cells for that purpose), the same name might be
selected multiple times. Also note that if you save and later re-open
the worksheet, you will likely find a different name selected.

If those are problems for you, feel free to post back to ask for
solutions.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Can excel pick a random cell from a column?

Another option, using RANDBETWEEN

Assuming names listed in col A
Then in say, B1:
=INDEX(A:A,RANDBETWEEN(1,COUNTA(A:A)))
will return a random name from col A
Press F9 to re-generate

Note that RANDBETWEEN requires the Analysis Toolpak (ATP)
to be installed and activated.

Check the "Analysis Toolpak" box (via Tools Add-Ins)

Chip Pearson's page has details on the ATP at:
http://www.cpearson.com/excel/ATP.htm
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Helene deChappe" wrote:
I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat. I thought I did this ions ago but maybe it was a dream???

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default Can excel pick a random cell from a column?

or you could use RAND() instead which doesn't require Analysis ToolPak, i.e.

=INDEX(A:A,RAND()*COUNTA(A:A)+1)

"Max" wrote:

Another option, using RANDBETWEEN

Assuming names listed in col A
Then in say, B1:
=INDEX(A:A,RANDBETWEEN(1,COUNTA(A:A)))
will return a random name from col A
Press F9 to re-generate

Note that RANDBETWEEN requires the Analysis Toolpak (ATP)
to be installed and activated.

Check the "Analysis Toolpak" box (via Tools Add-Ins)

Chip Pearson's page has details on the ATP at:
http://www.cpearson.com/excel/ATP.htm
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Helene deChappe" wrote:
I'm dong a random giveaway and have a huge list of name in an excel sheet. Is
there a way for excel to pick a random cell instead of printing, cutting and
pulling from a hat. I thought I did this ions ago but maybe it was a dream???

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
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 08:34 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"