LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Weighted randbetween text list

A | B
1 Name | Weight
2 Bob | 1
3 Joe | 1
4 Sue | 5
5 Nick | 1
6 Ike | 1

I'm trying to setup a formula to return a random text string (values from column A) based on weighted values (column B). I'm trying to have a cell return Sue 5 times as often as the others.

I've been searching for a couple afternoons now to no avail. The closest I came was the following formula:
=INDEX(A:A,MATCH(RANDBETWEEN(0,MAX(C:C)),C:C,1))

from http://www.excelforum.com/excel-form...ml#post1678471

But this would return reference errors because at some point, it would try to select value 8, but there were only 5 values.

I'm also tried modifying randbetween functions with counta and various other things.

=LOOKUP(RANDBETWEEN(1,SUM(Values!$I$26:$I$32)),Val ues!$H$26:$H$32,Values!$J$26:$J$32)

=INDEX(J26:J36,MATCH(RANDBETWEEN(0,MAX(L26:L37)),L 26:L37,1))

Selecting a text value from a list at random is easy, this weighted part is giving me trouble.

Thanks for any guidance!
 
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
Finding the weighted average of text that have been given values [email protected] Excel Worksheet Functions 2 April 23rd 14 02:26 PM
randbetween(1.1,1.25) Deniz Excel Worksheet Functions 3 July 10th 07 04:40 PM
randbetween [email protected] Excel Discussion (Misc queries) 1 November 21st 05 01:25 PM
Randbetween Gbonda Excel Discussion (Misc queries) 1 June 30th 05 02:39 PM
randbetween gives ?NAME Kristjan_Thor Excel Discussion (Misc queries) 5 March 14th 05 11:41 PM


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