+ Reply to Thread
Results 1 to 4 of 4

Indirect concatenate cell reference resulting in error

  1. #1
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Indirect concatenate cell reference resulting in error

    Me again, with a new problem it's been stumping me for hours

    I am referencing cells in a sheet within a document. Nice and simple =Sheet1!A1 (that sort of thing) My first problem - which I solved - was when I copied the formula into another workbook, it drags the original workbook file name in so it doesn't point to the new sheet. So it changed the formula to ='[original worksheet.xlsx]Sheet1'!A1

    I resolved this by populating a cell with the current file name using =CELL("filename") and forcing my cell reference formula to look at the file name first, then the cell reference using INDIRECT(CONCATENATE()). This works nicely when I paste both the file name and cell ref formulas into another workbook.

    My file name is in cell B2. The data I want to reference is in a sheet called 'Membership List' and the data starts on D17, but I also care about the data down to D200.

    This is the formula with the hard-coded cell reference which works for the single row: =INDIRECT(CONCATENATE("'[",$B$2,"]Membership List'!$D17"))

    However, my new problem is that I want to drag this cell reference formula down to other rows, and have the cell reference dynamically change the row number. But, when using the indirect concatenate functions, I am hard-coding the cell reference in using quotes. Which means dragging down the formula is simply replicating cell D17. So, i'm trying to take the cell reference outside the concatenate part of the formula, so it changes when you drag it down.

    I'm getting a #VALUE! error with my attempt to do this, and i'm stuck on how to fix this - if even I can.

    This is my formula where I try to pull the cell D17 outside the formula: =INDIRECT(CONCATENATE("'[",$B$2,"]"),'Membership List'!$D17)

    Is there a way around this?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Indirect concatenate cell reference resulting in error

    Me again, with a new problem it's been stumping me for hours
    Any chance you could sign off all the other queries you've posted first? We do expect a bit of feedback when we offer help and that you will mark threads as solved. Thank you.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  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: Indirect concatenate cell reference resulting in error

    If you only want to copy the formula down, then it is only the row reference that will change, so try it this way:

    =INDIRECT(CONCATENATE("'[",$B$2,"]Membership List'!$D",ROWS($1:17)))

    Note that you could avoid using the CONCATENATE function by using the concatenation operator ( & ), like this:

    =INDIRECT("'[" & $B$2 & "]Membership List'!D" & ROWS($1:17))

    which makes it a bit shorter.

    Note also that INDIRECT only works with files that are open, so you need to ensure that is the case.

    Hope this helps.

    Pete

  4. #4
    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: Indirect concatenate cell reference resulting in error

    Thanks for the rep.

    Pete

+ 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. Reference error when using INDIRECT and CONCAT
    By knkedia in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-31-2021, 02:13 AM
  2. Replies: 27
    Last Post: 11-27-2016, 11:02 AM
  3. INDIRECT referencing to the cell that changes dinamically -> REFERENCE ERROR
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2015, 09:52 AM
  4. INDIRECT when reference another list - error
    By HeroBiX in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-18-2014, 03:50 PM
  5. Replies: 1
    Last Post: 03-28-2006, 07:20 PM
  6. Find the Cell Reference Resulting from MAX function
    By Excel User in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-20-2005, 04:10 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