+ Reply to Thread
Results 1 to 9 of 9

Lookup / Indirect function to lookup information from various tabs/worksheets

  1. #1
    Registered User
    Join Date
    06-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Lookup / Indirect function to lookup information from various tabs/worksheets

    First post, please help if possible.

    In the attached file, I need a formula in B2 that can:-
    1: Find a tab/worksheet that is the same name as A2.
    2: On that tab/worksheet, find the heading that is the same as B1
    3: Return the value that is in row 12 of that tab
    4: Copy the formula for the above columns and rows.

    I have left only 2 tabs in to make the file smaller. Happy to provide further information if rquired.


    Thanks,
    Raj
    Attached Files Attached Files
    Last edited by rajeshpansara; 06-18-2019 at 01:14 AM. Reason: Solved

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    It would help if you provided some expected output?
    What info do you want from the sheet?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    Assuming you want to pull the data from row 2 (Units)...
    B2=IFERROR(INDEX(INDIRECT("'"&$A2&"'!C2:AG2"),MATCH(B$1,INDIRECT("'"&$A2&"'!C1:AG1"),0)),"")

    copied down and across as needed.

  4. #4
    Registered User
    Join Date
    06-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    Thanks FDibbins. I need the info from row 14 & 15 and have adjusted the formula to work. Thank you very much.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    Great stuff, happy to help

  6. #6
    Registered User
    Join Date
    06-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    HI Mr. Dibbons,

    Are you able to please give me some narrative about the formula that you have given me above in this post, it just so that I can understand it better and then replicate it / amend it for future use. Apologies if this in not ok to ask.

    Regards,
    Raj

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    Sure.

    This is really just a regular INDEX/MATCH, with the added complexity of using INDIRECT to ID the sheet you want to refer to...
    =IFERROR(INDEX(INDIRECT("'"&$A2&"'!C2:AG2"),MATCH(B$1,INDIRECT("'"&$A2&"'!C1:AG1"),0)),"")
    Broken down, it works like this, without the INDIRECT or IFERROR part...
    =INDEX('21 Genge St'!C2:AG2,MATCH(B$1,'21 Genge St'!C1:AG1,0))
    (looks a lot simpler there, doesnt it? - let me know if you need that part explained?)

    OK but because you want the formula to find the sheet name, instead of hard coding it, we need to use the INDIRECT function. The same principal to bot INDIRECTS there, so I will explain the 1st 1.
    =IFERROR(INDEX(INDIRECT("'"&$A2&"'!C2:AG2"),MATCH(B$1,INDIRECT("'"&$A2&"'!C1:AG1"),0)),"")

    INDIRECT("'"&$A2&"'!C2:AG2")
    If you look at the sheet reference in the simplified version, you will see it reads...
    '21 Genge St'!C2:AG2

    Note that there is ' surrounding the sheet name. Because the cell that contains the sheet name text does not contain those, we need to add them...
    INDIRECT("'"&$A2&"'!C2:AG2")
    However, because they are text, they need to be wrapped inside ""

    The & combines different text strings, so what we then have is...
    "'" and (the text in) $A2 and"'(...the cell range goes here, as another text string)!C2:AG2")

    Because that cell range is no longer an actual cell range, but has been converted to text, we can do away with the absoluting

    Did that make sense? If not, please shout again and I will try again

    (and thanks for the feedback)

  8. #8
    Registered User
    Join Date
    06-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    Thank you so much.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Lookup / Indirect function to lookup information from various tabs/worksheets

    Happy to help and thanks for the feedback

+ 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. Indirect and lookup across several worksheet tabs
    By flier109 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-19-2018, 06:17 PM
  2. INDIRECT sheet references within LOOKUP function
    By PeterScho in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-28-2016, 12:34 PM
  3. INDIRECT Function for Two-Dimensional Lookup
    By IMA_Saihat in forum Tips and Tutorials
    Replies: 3
    Last Post: 10-25-2015, 07:12 AM
  4. [SOLVED] How to use Indirect function in array lookup formula
    By PM1985 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-20-2014, 06:58 PM
  5. Set desired record by using search function - maybe indirect or lookup
    By Lydyth in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2014, 04:36 PM
  6. [SOLVED] LOOKUP function with SEARCH and INDIRECT
    By bubbacheese in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-13-2013, 03:55 PM
  7. Lookup and return information from several worksheets
    By JoeB in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-20-2005, 06:07 PM

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