+ Reply to Thread
Results 1 to 8 of 8

INDIRECT sheet references within LOOKUP function

  1. #1
    Registered User
    Join Date
    09-28-2016
    Location
    Germany
    MS-Off Ver
    Excel for Mac Version 15.17
    Posts
    4

    INDIRECT sheet references within LOOKUP function

    Let's say I have Sheet 'A', in which I want to gather information within one cell from another Sheet 'B' to Sheet 'Z'. I want the reference Sheet name to change dynamic, according to a cell value (text) I enter in Sheet A. The row from where the data needs to be picked up can differ, so I added a Value in a cell of the reference Sheet, that will not change. This is in the same row as the value I want to pickup.
    I've used LOOKUP on functions where my reference sheet does not change and this works fine for me. Working with variable reference sheet name, is just killing me right now. I need the sheet name 'Jul2016'! to be dynamic according to the value in B5 of my Sheet A.

    =LOOKUP("MonthKPIs";'Jul2016'!A:A;'Jul2016'!J:J)

    This is, what my function looks like at the moment. There seems to be something going wrong...

    =LOOKUP("MonthKPIs";INDIRECT("'"&B5&"'!&A:A");INDIRECT("'"&B5&"'!&J:J)

    MonthKPIs is the static cell value on all of my delivery sheets. So I want Excel to find this value on the sheet.

    The cell B5 on my destination sheet should define the name of the delivery sheet, where I know the reference value "MonthKPIs" is in column A. So I want Excel to find MonthKPIs on the Sheet that is defined be cell B5.

    The Value to return is in the same delivery sheet, but this time in column J. So I want Excel to return the value in column J of row "MonthsKPIs" on the sheet with the name from cell B5.

    Does this make sense to anyone? I'm not even 100% sure INDIRECT is the right thing to use...
    Last edited by PeterScho; 09-28-2016 at 09:40 AM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: INDIRECT sheet references within LOOKUP function

    I see a missing " and ) at the end, and extra & between ! and A:A/J:J
    =LOOKUP("MonthKPIs";INDIRECT("'"&B5&"'!&A:A");INDIRECT("'"&B5&"'!&J:J)
    Should be
    =LOOKUP("MonthKPIs";INDIRECT("'"&B5&"'!A:A");INDIRECT("'"&B5&"'!J:J"))
    Last edited by Jonmo1; 09-28-2016 at 10:11 AM.

  3. #3
    Registered User
    Join Date
    09-28-2016
    Location
    Germany
    MS-Off Ver
    Excel for Mac Version 15.17
    Posts
    4

    Re: INDIRECT sheet references within LOOKUP function

    Hi Jonmo,

    I've tried to directly past your string, doest't result either. I'm not sure if removing the & in the second INDIRECT expression was meant to be, so I tried the following as well:

    =LOOKUP("MonthKPIs";INDIRECT("'"&B5&"'!A:A");INDIRECT("'"&B5&"'!J:J))

    Unfortunately, it still doesn't resolve...

  4. #4
    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
    53,048

    Re: INDIRECT sheet references within LOOKUP function

    You still left out the closing " at the end
    =LOOKUP("MonthKPIs";INDIRECT("'"&B5&"'!A:A");INDIRECT("'"&B5&"'!J:J"))

    They are there because you are using a range that is text, and all text in a formula needs to be wrapped in ""
    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

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: INDIRECT sheet references within LOOKUP function

    Yeah, I had to edit my post a few times to get all the errors...
    OP must have copied it before I got it corrected..

  6. #6
    Registered User
    Join Date
    09-28-2016
    Location
    Germany
    MS-Off Ver
    Excel for Mac Version 15.17
    Posts
    4

    Re: INDIRECT sheet references within LOOKUP function

    Oh wow, it's working! Thanks you guys so much!

  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
    53,048

    Re: INDIRECT sheet references within LOOKUP function

    Jonmo, didnt mean to muscle in lol, wasnt sure you had seen the reply
    Happy to help, Jonmo did all the heavy lifting

  8. #8
    Registered User
    Join Date
    09-28-2016
    Location
    Germany
    MS-Off Ver
    Excel for Mac Version 15.17
    Posts
    4

    Re: INDIRECT sheet references within LOOKUP function

    Og god, I broke it. As my work was actually done and I was more or less ready to pass the baby on to my colleagues as a template I started protecting certain sheets. All of a sudden, some error message prompted in my face telling me something about fonts, that can'T be installed or applied or added or something. Anyway, I keep hitting 'OK', because I didn't want to add fonts anyway. Next thing I know, the formula doesn't work anymore, resolving the same thing as #N/A. I've tried formatting cells this and that way, hoping to be a lucky guys finding what was going on... No chance. I have no clue what happened and how to fix it. The formula is the exact same as before (I've even repasted it from here), but it's the same thing all the time... Any ideas? I'm already searching forums for anything similar... Thanks
    Peter

+ 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. [SOLVED] INDIRECT Function NOT capturing all of the references
    By Murphy15 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-09-2017, 10:00 PM
  2. [SOLVED] Changing Cell References inside INDIRECT function.
    By Zox Tomana in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-08-2016, 12:36 AM
  3. Using Structured Table References and Indirect Function
    By tjeasy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-02-2016, 07:07 PM
  4. Replies: 5
    Last Post: 01-30-2015, 06:39 PM
  5. [SOLVED] Changing cell references in INDIRECT function
    By GavJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2013, 11:38 PM
  6. Replies: 1
    Last Post: 02-18-2012, 10:31 AM
  7. Lookup function with different cell references
    By Nett in forum Excel General
    Replies: 3
    Last Post: 07-13-2009, 10:01 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