LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default 3 Column lookup table?

Correction:

Then, to get the random number associated with that location:
=VLOOKUP(B3,D1:E17,3)


The correct formula should be:

=VLOOKUP(B3,D1:F17,3)

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Ok...

Instead of using that long lookup formula build a 3 column like I
suggested:

0...Check
1...Office...=RANDBETWEEN(n,n)
6...Restaurant...=RANDBETWEEN(n,n)
12...Arsenal...=RANDBETWEEN(n,n)
18...Single_Family_House...=RANDBETWEEN(n,n)
..
..
90...Drug_Store...=RANDBETWEEN(n,n)

Let's assume this table is in the range D1:F17.

Then, to get the same result as that long lookup formula:

=VLOOKUP(B3,D1:E17,2)

Then, to get the random number associated with that location:

=VLOOKUP(B3,D1:E17,3)

--
Biff
Microsoft Excel MVP


<Rich Werkmeister wrote in message
...
I think what you're suggesting will work, but I don't know what it is or
how to use it. Here's the whole story, at least as much as pertains to
having a random number generated based upon the type of building generated
with each building having a different random number range.

I've got a table going, Column B is a random number 1-96 using
RANDBETWEEN(1,96). Based on that number Column C outputs what type of
building it is using
=LOOKUP(B3,{0,1,6,12,18,24,30,36,42,48,54,60,66,72 ,78,84,90,97},{"Check","Office","Restaurant","Arse nal","Single_Family_House","Department_Store","Pol ice_Station","Hardware_Store","Gas
Station_/_Garage","Convenience_Store","Factory","Warehouse" ,"Hospital","Fire_Station","Specialty_Retail","Sup ermarket","Drug_Store"}).

Now I need Column D to reference either Column B or C, doesn't matter
because they pretty much mean the same thing and Column B just randomly
determines what kind it is and Column C actually puts it into text, but
base on what Column B or C is, it'll be a different =RANDBETWEEN(n,n)
value. Like Office is =RANDBETWEEN(2,16).

By the way, the numerical range for each building type is what I've
converted from a dice roll, so =RANDBETWEEN(2,16) is actually the same as
rolling 2d8, or two 8-sided dice.

I was actually thinking of using a massive nested =IF() statement for
this last part, but that may or may not work. I believe I'd have to have
the true_value be the =RANDBETWEEN() value for that building, but I don't
know if it'll let me just throw the formula into it.



T. Valko wrote:

Why do not you create a 3 column lookup table like this:1...Office...
02-Nov-09

Why do not 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

Previous Posts In This Thread:

EggHeadCafe - Software Developer Portal of Choice
The Guru's Guide To Transact-SQL
http://www.eggheadcafe.com/tutorials...-to-trans.aspx







 
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
Lookup Formula SpencerMC Excel Worksheet Functions 3 February 11th 09 05:18 PM
Utilizing a Cell even with a Formula located inside it Ahh, Excel's Tough Excel Worksheet Functions 4 July 3rd 07 01:13 AM
I: Utilizing non-standard graphs Rominall Charts and Charting in Excel 1 April 21st 07 12:40 AM
Lookup Formula abcdexcel Excel Discussion (Misc queries) 7 January 4th 06 05:20 AM
Lookup Formula - but have a formula if it can't find/match a value Stephen Excel Worksheet Functions 11 June 14th 05 05:32 AM


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