+ Reply to Thread
Results 1 to 16 of 16

indirect not doing anything

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    indirect not doing anything

    Hello. I have the following formula ="["&INDIRECT("AA12")&".xls]Sheet1!C15" and it's intended to return that value in C15 in a different workbook. However, all it's doing is writing the text in the cell. How can I fix this?

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

    Re: indirect not doing anything

    Remove the "" around AA12
    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 Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    Now it gives me a ref error. The value that I have in AA12 is 41655 (date).

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: indirect not doing anything

    eveything meets to be in the indirect this works
    =INDIRECT("["&AA12&"]Sheet1!C15")
    what is the name of the workbook?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    Oh nice, @martindwilson. Your formula worked. Can you explain what it is doing and why Fdibbins formula didn't work? Also, can I subtract 1 from the number within the indirect? So it will reference 41655 but return 41644? Thanks.
    Last edited by ammartino44; 02-21-2014 at 05:51 PM.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: indirect not doing anything

    you need to build the whole reference inside the indirect
    i tried it this way and it also works
    =INDIRECT("'["&AA12&".xlsx]Sheet1'!C15")
    if you try
    ="c"&a1 where a1= 5 and c5=100 you get text of "c5"
    if you wrap it in indirect
    =INDIRECT("c"&A1) you get what is in c5 ie 100
    this is what i see
    Attached Images Attached Images
    Last edited by martindwilson; 02-21-2014 at 05:56 PM.

  7. #7
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    When I use xls it works, but not when I use your xlsx. Why is that?

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: indirect not doing anything

    probably because the file i'm looking at is a .xlsx?

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

    Re: indirect not doing anything

    If your file is .xlsx, then it will not be able to find .xls

  10. #10
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    Makes sense haha. Last question: If I wanted to use the indirect above but use this formula instead of the C15 reference, how could I do that? OFFSET($A$8,MATCH("COMPANY TOTAL",$A$8:$A$851,0)-1,4)

  11. #11
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    Maybe I'll start a new thread.

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: indirect not doing anything

    why are you using offset?
    =INDEX($E$8:$E$851,MATCH("company total",$A$8:$A$851,0)) is more practical

  13. #13
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    I'm using offset because there are multiple instances of particular lookups. I could be wrong though. Why are you using E? I need to combine the indirect formula above with the lookup formula I created (or a better one) so that it does the lookup on that particular workbook.

  14. #14
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: indirect not doing anything

    because that is where the offset is looking 4 columns away from column A ie column E

  15. #15
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: indirect not doing anything

    Ok. So, how would you combine that formula with the indirect formula that you gave me above?

  16. #16
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: indirect not doing anything

    done in other thread

+ 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. Sum of indirect sheet names with multiple cells (SUM, INDIRECT,SHEETNAME in cell)
    By a1b2c3d4e5f6g7h8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-12-2013, 08:42 AM
  2. [SOLVED] INDIRECT Query: How to incorporate INDIRECT to choose between two ranges?
    By The_Snook in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-18-2012, 06:28 AM
  3. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Andy Wiggins in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 07:05 AM
  4. Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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