View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Utilizing a RANDBETWEEN() formula within a LOOKUP formula

Why don't you create a 3 column lookup table like this:

1...Office...=RANDBETWEEN(n,n)
7...Kitchen...=RANDBETWEEN(n,n)
13...Diner...=RANDBETWEEN(n,n)

Or, am I not following you?

--
Biff
Microsoft Excel MVP


"Rich Werk." wrote in message
...
I'm trying to make a sheet that'll determine various qualities depending
on a
given number, one of those qualities is a randomly determined number
within a
variety of ranges.
For example: If the number is within the range of 1-6 "Office" will be
output. From this "Office" output I need the sheet to generate a number in
the range of 2-16. The problem I'm having is that I have 16 initial
ranges
from 1-96 which result in a different type of building being selected.
Based
on which building is selected, I need the formula to spit out a number
from a
range that is determined by the type of building.

The formula I attempted to use was rather long and still didn't work:

LOOKUP(B3,{0,1,6,12,18,24....},{=RANDBETWEEN(1,3), =RANDBETWEEN(2,16),...

and so forth. That didn't work and now I'm attempting to use a really
long
IF statement to achieve the desired effect.

Does anyone know how to do this or if EXCEL 2007 is even capable of it?