+ Reply to Thread
Results 1 to 3 of 3

Can I avoid multiple conditions with dynamic sheet reference?

  1. #1
    Registered User
    Join Date
    05-09-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Can I avoid multiple conditions with dynamic sheet reference?

    Im trying to get a worksheet to lookup values in tables accross multiple sheets, deciding which sheet to look at by me changing the value in a box say A3, so far I have multiple IF(Value in A3=x look in Xsheet, if not, if it is y look in y sheet, if it is none, "Error") this is obviously tiresome to do, and gets very long excel equations causing me trouble

    Id like to have something llke

    =Lookup($C$3, $A$3!A:A,$A$3!C:C) but this isnt working for some reason.

    There must be some function or some trick to allow me to do this, I just have no idea what it is.

    Many Thanks

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Can I avoid multiple conditions with dynamic sheet reference?

    Hi Eskpe, and welcome to the forum.

    You might want to research the INDIRECT function. In your example, this should work for you:

    =LOOKUP(C3,INDIRECT(A3&"!A:A"),INDIRECT(A3&"!C:C"))

    Hope that helps!

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can I avoid multiple conditions with dynamic sheet reference?

    heres a good quick tutorial
    http://www.brainbell.com/tutorials/m...ple_Tables.htm
    there is also this udf from ozgrid which does a vlookup across the same range on all sheets

    http://www.ozgrid.com/VBA/VlookupAllSheets.htm


    Please Login or Register  to view this content.
    once inserted in a new module(see where do i put code link in my signature)exactly the same as vlookup but use VLOOKAllSheets
    =VLOOKAllSheets("your item",A1:A10,2,FALSE)
    Last edited by martindwilson; 05-10-2009 at 04:33 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1