Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Excel Look Up Tables - Make The Table Dynamic?

Hi.

If I have a value that I want to use to look up in a table but not
necessarily in the same table each time. Is it possible to set the Lookup
Range to be dynamic so that I can specify which table is being looked at by
changing a value in a combo box rather than having to change the formula in
the result cell?

Cheers.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Excel Look Up Tables - Make The Table Dynamic?

Yes, you can do this.

How many items are in your combo box?

It'd be easier to use a data validation drop down list.

If you link the combo box to a cell the *number* of the item that is
selected is returned to the linked cell. You'd then have to parse what item
corresponds to the number.

If you use a DV drop down list you don't have to go through that extra step.
For example:

A1 = data validation drop down list. The selections are named ranges to use
in a VLOOKUP formula.

Then your lookup formula would be:

=VLOOKUP(lookup_value,INDIRECT(A1),col_index_numbe r,range_lookup)

Biff

"Ben Bruce" wrote in message
...
Hi.

If I have a value that I want to use to look up in a table but not
necessarily in the same table each time. Is it possible to set the Lookup
Range to be dynamic so that I can specify which table is being looked at
by
changing a value in a combo box rather than having to change the formula
in
the result cell?

Cheers.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Excel Look Up Tables - Make The Table Dynamic?

NB:

If your named ranges are *dynamic ranges* then a different formula will be
needed. If that's the case this adds that extra step back into the process
and you might as well just stick with a combo box.

Biff

"T. Valko" wrote in message
...
Yes, you can do this.

How many items are in your combo box?

It'd be easier to use a data validation drop down list.

If you link the combo box to a cell the *number* of the item that is
selected is returned to the linked cell. You'd then have to parse what
item corresponds to the number.

If you use a DV drop down list you don't have to go through that extra
step. For example:

A1 = data validation drop down list. The selections are named ranges to
use in a VLOOKUP formula.

Then your lookup formula would be:

=VLOOKUP(lookup_value,INDIRECT(A1),col_index_numbe r,range_lookup)

Biff

"Ben Bruce" wrote in message
...
Hi.

If I have a value that I want to use to look up in a table but not
necessarily in the same table each time. Is it possible to set the Lookup
Range to be dynamic so that I can specify which table is being looked at
by
changing a value in a combo box rather than having to change the formula
in
the result cell?

Cheers.





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default Excel Look Up Tables - Make The Table Dynamic?

Hi


"T. Valko" wrote in message
...
NB:

If your named ranges are *dynamic ranges* then a different formula will be
needed. If that's the case this adds that extra step back into the process
and you might as well just stick with a combo box.



Not at all!

An example:
=CHOOSE(MATCH(A1,{Value1;Value2;Value3;...},0),Ran ge1,Range2,Range3,...)



--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Excel Look Up Tables - Make The Table Dynamic?

Not at all!

What I meant was:

If your named ranges are *dynamic ranges* then a different formula will be
needed.


=VLOOKUP(lookup_value,INDIRECT(A1),col_index_numbe r,range_lookup)

Will not work with a dynamic range and therefore a different formula would
be needed.

Biff

"Arvi Laanemets" wrote in message
...
Hi


"T. Valko" wrote in message
...
NB:

If your named ranges are *dynamic ranges* then a different formula will
be needed. If that's the case this adds that extra step back into the
process and you might as well just stick with a combo box.



Not at all!

An example:
=CHOOSE(MATCH(A1,{Value1;Value2;Value3;...},0),Ran ge1,Range2,Range3,...)



--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default Excel Look Up Tables - Make The Table Dynamic?

Hi

To use with VLOOKUP, I'd create an additional named range, i.e.

- You have some named ranges Name1, Name2, ...
- You create a named range, p.e. LookupRange, which returns one of those,
depending on value in cell SomeSheet!$A$1
- Your lookup formula will be:
=VLOOKUP(lookup_value,LookupRange,col_index_number ,range_lookup)

A bonus is, that whenever you need to change rules for selecting named
ranges, you have to change them once - for LookupRange - instead editing
every formula in workbook.



--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"T. Valko" wrote in message
...
Not at all!


What I meant was:

If your named ranges are *dynamic ranges* then a different formula will be
needed.


=VLOOKUP(lookup_value,INDIRECT(A1),col_index_numbe r,range_lookup)

Will not work with a dynamic range and therefore a different formula would
be needed.

Biff

"Arvi Laanemets" wrote in message
...
Hi


"T. Valko" wrote in message
...
NB:

If your named ranges are *dynamic ranges* then a different formula will
be needed. If that's the case this adds that extra step back into the
process and you might as well just stick with a combo box.



Not at all!

An example:
=CHOOSE(MATCH(A1,{Value1;Value2;Value3;...},0),Ran ge1,Range2,Range3,...)



--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )





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
How do I make a dynamic print range in excel? Herd Excel Discussion (Misc queries) 4 August 15th 09 03:15 AM
Pivot tables and dynamic columns excelboy Charts and Charting in Excel 4 August 17th 06 03:23 AM
Dynamic scenarios - more than 2 variable using data tables in Exc Varghese Excel Discussion (Misc queries) 0 August 7th 06 03:16 PM
Make dynamic charts more dynamic Milo Charts and Charting in Excel 1 April 12th 06 09:01 AM
Dynamic Pivot tables Phil Excel Discussion (Misc queries) 3 January 31st 05 03:33 PM


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