Hi,
I am trying to return a different random number range based on a variable value. I would have used the IF function but that is limited to 7 arguments.
Here are the ranges I plan to use. I am not worried if the random number is duplicated as I plan to use decimals.
Group Range
Group 01 1 - 50
Group 02 51 - 100
Group 03 101 - 150
Group 04 151 - 200
Group 05 201 - 250
Group 06 251 - 300
Group 07 301 - 350
Group 08 351 - 400
Group 09 401 - 450
Group 10 451 - 500
Group 11 501 - 550
Group 12 551 - 600
Group 13 601 - 650
Group 14 651 - 700
Group 15 701 - 750
Group 16 751 - 800
Group 17 801 - 850
Group 18 850 - 900
Hope this makes sense and someone can help.
Last edited by cfherd; 11-23-2011 at 04:38 AM.
Hi,
Maybe something like the attached.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Ηι
You can use what "if" you want, using the symbol +.
Another solution is to use INDEX&MATCH.
Regards
Fotis.
I am proud that i am Greek.
Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?
Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Please,mark your thread [SOLVED] if you received your answer.
My Avadar picture, is from Athens Acropolis.
http://www.theacropolismuseum.gr
http://www.visitgreece.gr/
Lets' say your group # is in A2 in the form of "Group 02" (it would help if you uploaded an example workbook)
=IF(ISTEXT(A2),RANDBETWEEN(MID(A2,6,5)*50-49,MID(A2,6,5)*50),"")
If you just have the group # as a number, that simplifies to
=IF(ISNUMBER(A2),RANDBETWEEN(A2*50-49,A2*50),"")
ChemistB
My 2¢
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
Thanks for the reply folks, didn't realise that I would get such a quick response. Fortunatly the first answer worked like a charm! Thanks again. Chris.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks