+ Reply to Thread
Results 1 to 13 of 13

Reference a specific cell for part of workbook name in formula

  1. #1
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Reference a specific cell for part of workbook name in formula

    I am using the following formula to obtain data from a workbook.

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


    Is it possible to reference a cell value for part of the workbook's name in my formula. For example In the workbook that contains the formula I have the month and year (May 2013 ) in cell G2. So I am looking to do something like the following.


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


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



    Is this even possible?

  2. #2
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Reference a specific cell for part of workbook name in formula

    You have to use the INDIRECT formula to reference it:

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


    That should work

    Regards
    Duncan

  3. #3
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Re: Reference a specific cell for part of workbook name in formula

    duncandhu, I had originally tried using the INDIRECT formula with no luck. I copied yours and the formula returned #REF!.

  4. #4
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Reference a specific cell for part of workbook name in formula

    Quote Originally Posted by randolphoralph View Post
    duncandhu, I had originally tried using the INDIRECT formula with no luck. I copied yours and the formula returned #REF!.
    I think this will only work if the file is open. If the file is closed you need to provide the full path to the file.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Reference a specific cell for part of workbook name in formula

    @randolphoralph,

    Duncan's formula will work, but you need to adjust the workbook extension. Instead of .xslx you need to reverse it to .xlsx
    HTH
    Regards, Jeff

  6. #6
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Re: Reference a specific cell for part of workbook name in formula

    Quote Originally Posted by duncandhu View Post
    I think this will only work if the file is open. If the file is closed you need to provide the full path to the file.
    Even with the file open I have had no luck.

  7. #7
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Re: Reference a specific cell for part of workbook name in formula

    Quote Originally Posted by jeffreybrown View Post
    @randolphoralph,

    Duncan's formula will work, but you need to adjust the workbook extension. Instead of .xslx you need to reverse it to .xlsx

    Don't I feel silly...did not even pick up on that. Thanks guys!

  8. #8
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Reference a specific cell for part of workbook name in formula

    Quote Originally Posted by randolphoralph View Post
    Don't I feel silly...did not even pick up on that. Thanks guys!
    Schoolboy error! Sorry about that!

  9. #9
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Re: Reference a specific cell for part of workbook name in formula

    Ok so I have gotten the formula to work with the workbook open. Once I close the workbook the formula no longer calculates. Below is my attempt at adding the location so that the formula works when the source workbook is closed.

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


    I must be missing something. Funny thing is with the location data included it will calculate with the source open, but not closed.
    Last edited by randolphoralph; 06-04-2013 at 12:00 PM.

  10. #10
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Reference a specific cell for part of workbook name in formula

    Quote Originally Posted by randolphoralph View Post
    Ok so I have gotten the formula to work with the workbook open. Once I close the workbook the formula no longer calculates. Below is my attempt at adding the location so that the formula works when the source workbook is closed.

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


    I must be missing something.
    Put the whole path inside the square brackets.

    Thanks
    Duncan

  11. #11
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Re: Reference a specific cell for part of workbook name in formula

    Tried it and no success

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

  12. #12
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Re: Reference a specific cell for part of workbook name in formula

    Doing some additional research on good ole google....it appears that the INDIRECT function can not be used to pull data from a closed workbook. Back to square #1

  13. #13
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Reference a specific cell for part of workbook name in formula

    Apologies randolphoralph, it seems my proposed solution will not work for you.

    Regards
    Duncan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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