+ Reply to Thread
Results 1 to 6 of 6

Use INDIRECT to build a dynamic reference is causing #REF error

  1. #1
    Forum Contributor
    Join Date
    02-27-2004
    Location
    California, United States
    MS-Off Ver
    Excel 2016
    Posts
    315

    Use INDIRECT to build a dynamic reference is causing #REF error

    I am tying to use Indirect to build a dynamic statement. I keep getting the #REF error and I haven't been able to figure out how to do it correctly.

    I have the pieces of the reference in different cells.

    A1 = MW
    A3 = 01

    and the cell on the tab I want to reference is L27 (just for kicks it equals 3,003)

    I am constructing the Indirect statement as such:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and I need it to return this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Any help would be greatly appreciated. Thank you!!

  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,933

    Re: Use INDIRECT to build a dynamic reference is causing #REF error

    Perhaps this?

    =indirect("'"&A1&" "$A3&"'!L27")
    Last edited by FDibbins; 02-27-2017 at 02:11 PM. Reason: left out the '! lol
    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
    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: Use INDIRECT to build a dynamic reference is causing #REF error

    Try it like this:

    =INDIRECT("'" & A1 & " " & A3 & "'!L27")

    You had some spaces in there which adds to the reference, and so it did not match with your tab names. Also, the L27 should be inside the quotes.

    Hope this helps.

    Pete

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Use INDIRECT to build a dynamic reference is causing #REF error

    If the number is always "01" and not "1" then try

    =INDIRECT("'"&A1&" "&TEXT(A3,"00")&"'!L27")
    Last edited by Speshul; 02-27-2017 at 02:16 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  5. #5
    Forum Contributor
    Join Date
    02-27-2004
    Location
    California, United States
    MS-Off Ver
    Excel 2016
    Posts
    315

    Re: Use INDIRECT to build a dynamic reference is causing #REF error

    Thank you all for the responses. You have solved my problem. It was those extra spaces and not pulling the tab's cell reference into the quotes that killed me.

    As always, the Excel forum is the best ever!!!!

    Cliff

  6. #6
    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,933

    Re: Use INDIRECT to build a dynamic reference is causing #REF error

    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. Using INDIRECT formula to reference a dynamic range on another sheet
    By Travisty in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-01-2018, 12:22 PM
  2. Replies: 1
    Last Post: 04-10-2015, 11:53 AM
  3. INDIRECT when reference another list - error
    By HeroBiX in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-18-2014, 03:50 PM
  4. VBA Dynamic Range - An Indirect Cell Reference
    By ExcelHelp2013 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2013, 11:08 AM
  5. [SOLVED] Dynamic VLOOKUP wit INDIRECT reference
    By supern0va in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-29-2012, 11:44 AM
  6. Named dynamic ranges causing worksheet error
    By dta1984 in forum Excel General
    Replies: 7
    Last Post: 01-04-2012, 01:06 PM
  7. INDIRECT to Reference Worksheets #Ref Error
    By McToons in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2011, 03:46 AM

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