+ Reply to Thread
Results 1 to 5 of 5

INDIRECT Function Gives #VALUE! Error on Reopening

  1. #1
    Registered User
    Join Date
    06-24-2020
    Location
    Dublin, California
    MS-Off Ver
    V16.38 for Mac
    Posts
    3

    INDIRECT Function Gives #VALUE! Error on Reopening

    I'm running into an odd problem with Excel. I have a workbook that gets external data from a text file and puts it in column A of the "Raw Data" tab. I then use the following in another sheet to read the data line by line:

    =IF(LEFT(INDIRECT("'Raw Data'!$A"&ROW()),4)="Name",1,0)

    This works great until I close the workbook. When I close and reopen it, I get the #VALUE! error everywhere I use the INDIRECT function. If I put my cursor in the function bar and click out of it, all the INDIRECTs suddenly fix themselves. I'm building this for a client and would rather not explain the t they have to do this fix every time they open the file. Any guesses?

    Thanks in advance.
    Last edited by Rob Bennett; 06-25-2020 at 12:47 AM.

  2. #2
    Registered User
    Join Date
    06-24-2020
    Location
    Dublin, California
    MS-Off Ver
    V16.38 for Mac
    Posts
    3

    Re: INDIRECT Function Gives #VALUE! Error on Reopening

    Never mind - found the solution.

    Apparently the INDIRECT function doesn't like the & concatenator on startup. I replaced the equation with this:

    =IF(LEFT(INDIRECT(CONCAT("'Raw Data'!A",ROW())),4)="Name",1,0)

    It now works just fine.
    Last edited by Rob Bennett; 06-25-2020 at 12:46 AM.

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

    Re: INDIRECT Function Gives #VALUE! Error on Reopening

    I have never had a problem using & in an INDIRECT function, in fact you need to use it, most of the time. There must be another reason. Are you by any chance referencing a closed WB?
    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

  4. #4
    Registered User
    Join Date
    06-24-2020
    Location
    Dublin, California
    MS-Off Ver
    V16.38 for Mac
    Posts
    3

    Re: INDIRECT Function Gives #VALUE! Error on Reopening

    Thanks, Ford.

    I’ve never had a problem with using & either. I am referencing a different sheet in the same workbook, so it should work, but it failed every time I reopened the workbook. The only change I made was swapping & with CONCAT(), and now it works. I even simplified it:

    =INDIRECT("'Raw Data'!A"&ROW()) — #VALUE! on reopen

    =INDIRECT(CONCAT("'Raw Data'!A",ROW())) — works every time

    Sounds like a bug to me....

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

    Re: INDIRECT Function Gives #VALUE! Error on Reopening

    hmmm strange. Any chance of a sample WB to test?

+ 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 function gives Circular error
    By BPraveen in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-14-2019, 08:12 AM
  2. #VALUE error in INDIRECT function
    By jlawton1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-03-2016, 11:52 PM
  3. Indirect Function getting a #Value Error
    By bblackwelder in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2014, 09:54 PM
  4. [SOLVED] Help Solving #REF error (INDIRECT function)
    By omni13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2014, 10:01 AM
  5. [SOLVED] Indirect function giving #REF! error
    By mqdias in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-03-2013, 10:21 AM
  6. Hiding !REF# Error using =indirect() function
    By Ace of Clubs in forum Excel General
    Replies: 4
    Last Post: 07-07-2009, 02:20 AM
  7. INDIRECT function error
    By Anthony Slater in forum Excel General
    Replies: 3
    Last Post: 02-21-2005, 03: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