Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27
Default selecting randomly specific value in a list

Hi all,

I have a list of data with 8 records, these records can be either N/A
or the name of a user.


Column A
User1
User2
User3
N/A
User5
N/A
N/A
User8


I would like to choose at random only the name of one of the user and
not selecting the N/A, would it be possible with an excel formula?


Thank you

Nico
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default selecting randomly specific value in a list

=OFFSET($A$1,CHOOSE(RANDBETWEEN(1,5),1,2,3,5,8)-1,0)

--
Gary''s Student - gsnu2007L
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default selecting randomly specific value in a list

Say your data are in A2:A9. Use the following *array* formula:

=INDEX(A2:A9,LARGE(IF(1-ISERROR(A2:A9),ROW(A2:A9)-ROW(A2)+1),1+INT(RAND
()*SUMPRODUCT(1-ISERROR(A2:A9)))))

As it is an array formula you need to commit with Shift+Ctrl+Enter

HTH
Kostis Vezerides

On Mar 13, 12:24*pm, Nicawette wrote:
Hi all,

I have a list of data with 8 records, these records can be either N/A
or the name of a user.

Column A
User1
User2
User3
N/A
User5
N/A
N/A
User8

I would like to choose at random only the name of one of the user and
not selecting the N/A, would it be possible with an excel formula?

Thank you

Nico


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 69
Default selecting randomly specific value in a list

Hi Nicawette,

Put following formula in cell b2 and drag it up to end.

=IF(a2="N/A","",COUNTA($A$2:A2)-COUNTIF($A$2:A2,"N/A"))

Now put following formula say in cell C1

=INT(RAND()*(MAX(B2:B100)-1)+2)

Put following formula in say cell C2

=INDEX(A2:A100,C1)


H S Shastri

If useful pl press YES.


++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++

"Nicawette" wrote:

Hi all,

I have a list of data with 8 records, these records can be either N/A
or the name of a user.


Column A
User1
User2
User3
N/A
User5
N/A
N/A
User8


I would like to choose at random only the name of one of the user and
not selecting the N/A, would it be possible with an excel formula?


Thank you

Nico

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27
Default selecting randomly specific value in a list

Dear Kostis

thank you for your help,

The problem is that the N/A value that I have in my list is not the
"real" #N/A error of excel, thus the iserror function can not be
applied.

Nicolas


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27
Default selecting randomly specific value in a list

Dear Shastri,

unfortunately the process described does not return the expected
result,

thank you for your efforts

Nico
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default selecting randomly specific value in a list

If there is a particular string that you want to avoid, e.g.
"myvalue", then use the following variant (again an array formula)

=INDEX(A2:A9,LARGE(IF(A2:A9<"myvalue",ROW(A2:A9)-ROW(A2)+1),1+INT(RAND
()*SUMPRODUCT(--(A2:A9<"myvalue")))))

HTH
Kostis

On Mar 13, 6:03*pm, Nicawette wrote:
Dear Kostis

thank you for your help,

The problem is that the N/A value that I have in my list is not the
"real" #N/A error of excel, thus the iserror function can not be
applied.

Nicolas


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27
Default selecting randomly specific value in a list

Dear Kostis,

GR8, It is exactly what I want, thank you for the tip

Thank you & TGIF
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default selecting randomly specific value in a list

Glad to be of help.

Enjoy the wknd too!

On Mar 13, 6:45*pm, Nicawette wrote:
Dear Kostis,

GR8, It is exactly what I want, thank you for the tip

Thank you & TGIF


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
Randomly Generate Specific Data Bill Excel Worksheet Functions 2 November 14th 08 02:38 PM
Selecting the value from a randomly selected cell out of a range Steve W. Excel Discussion (Misc queries) 1 June 3rd 08 06:27 PM
Hi--how do I scramble a list randomly? lmcshelp Excel Worksheet Functions 1 November 1st 06 06:34 AM
Randomly Generated List / Macro carl Excel Worksheet Functions 3 April 9th 06 01:14 AM
How to randomly select from a list with condition kathyxyz Excel Worksheet Functions 5 July 27th 05 04:19 PM


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

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"