+ Reply to Thread
Results 1 to 3 of 3

Using in Formula, Ref to a Sheet, a Cell Ref Cont the Sheet Name, Inst of Name Itself

  1. #1
    Registered User
    Join Date
    12-08-2012
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    2

    Using in Formula, Ref to a Sheet, a Cell Ref Cont the Sheet Name, Inst of Name Itself

    Hi there,

    Is anybody aware of an option to use e. g. in a vlookup a reference to a cell in the “source sheet” instead of the sheet name?

    I have quite some sheets w/ similar data sets – which I due to various reasons cannot combine in one sheet.
    E. g. in column A of the consolidation sheet the primary key is listed.

    Not to search for each vlookup or index/match the correct sheet the primary key is belonging to, my idea was to do it one time for identification of the sheet. With one check in a consolidation sheet, I identify the “source sheet” of a data set, e. g. in column b.

    The next columns are intended to perform vlookups based on the primary key in column A, but only based on the sheet which is stated in column B. Of course I can do an if formula w/ all the various tabs – but hoped that I can just reference column b for the sheet, as otherwise it is almost the same to perform if(iserror(vlookup(…),if(iserror(vlookup(…)… for each cell:

    A2=<prim_key>
    B2=<sheet_name> identified via a “one time” vlookup searching sheet by sheet the primaray key w/ iserror
    C2=VLOOKUP(a2; '[?!?!?]'!A:W;MATCH("<column_header>";'[?!?!?]'!$1:$1;0);FALSE))

    Where [?!?!?] should be replaced ideally by b2 – which is directly not possible …
    Is there a known trick how to cheat XLSx to accept instead of the right sheet name the reference to a cell where the sheet name is stated?

    Feedback highly welcome – as the if clauses make the formulas way harder to read, and slow down the performance when filtering.

    Looking forward for creative ideas 
    RoadRunner

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Using in Formula, Ref to a Sheet, a Cell Ref Cont the Sheet Name, Inst of Name Itself

    Use INDIRECT, like this:

    C2=VLOOKUP(a2; INDIRECT("'"&$B$2&"'!A:W");MATCH("<column_header>";INDIRECT("'"&$B$2&"'!$1:$1");0);FALSE)

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-08-2012
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    2

    Thumbs up Re: Using in Formula, Ref to a Sheet, a Cell Ref Cont the Sheet Name, Inst of Name Itself

    Love it :-) !

    Actually I tried arround w/ indirect but "mixed" the <"> and <'> incorrectly ...

    Thanks a lot :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 08-21-2014, 07:34 PM
  2. [SOLVED] Use cell reference on one sheet as a sheet name in a formula on another sheet
    By GavJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-10-2013, 05:06 AM
  3. Replies: 1
    Last Post: 07-30-2012, 02:35 PM
  4. Indirect Formula to return Text from one sheet to cell in another sheet
    By lou031205 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-04-2007, 02:51 PM
  5. [SOLVED] Lookup cell contents in on sheet based on a formula in second sheet
    By Michael Wright via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2005, 12:06 PM

Tags for this Thread

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