+ Reply to Thread
Results 1 to 14 of 14

Help with formula to pick up a file path to a workbook from a cell in the same worksheet

  1. #1
    Registered User
    Join Date
    01-12-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    6

    Help with formula to pick up a file path to a workbook from a cell in the same worksheet

    Hi everyone,

    I have a bit of a problem. I am trying to make a series of workbooks which contain different stages of a fairly complicated report. There are over 60 reports in total so having multiple workbooks is the only way to separate it to a level that can be usable by anyone.

    What I am trying to do is get my Index function to work across workbooks. I can link the workbooks manually but this is time consuming and is prone to mistakes and more problems.

    This is my Formula atm with some test names and such put in just for examples:

    {=INDEX('C:\Users\Ian Stubbs\Documents\Jason Work Experience\[1392_39_JS02216S1R.xlsx]Sheet1'!$C$1:$C$2500,MATCH(1,($A6='C:\Users\Ian Stubbs\Documents\Jason Work Experience\[1392_39_JS02216S1R.xlsx]Sheet1'!$B$1:$B$2500)*($E6='C:\Users\Ian Stubbs\Documents\Jason Work Experience\[1392_39_JS02216S1R.xlsx]Sheet1'!$E$1:$E$2500),0))}

    The formula works absolutely fine but has to be manually linked for each new report as they all have different numbers for the file name. I am wondering if it is at all possible to replace the filepath links in this formula with a cell in the same worksheet. And then within that cell it contains the filepath to the required file. However every time I have attempted to do this it simply won't load the filepath properly and returns an error.

    Can anyone help at all?
    Last edited by Laura_93; 01-12-2015 at 12:49 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,603

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    The function you need is INDIRECT. But... it only works on OPEN workbooks, a little quirk of Excel. If you can download and use 3rd party software, Morefunc (google it - it's free) has a neat function (INDIRECT.EXT) which will allow you to reference a filename from a cell and return a value from a cell in that worksheet, even if it's closed.

    can you attach a mock-up in an Excel sheet or two to show us exactly what you need, just in case I've misunderstood you? Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    May be you can make list in what folder your file and used t on formula so you no need type too long on every formula?
    Click (*) if you received helpful response.

    Regards,
    David

  4. #4
    Registered User
    Join Date
    01-12-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    6

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    Hi, thanks for the quick response.

    I think I have seen the INDIRECT Formula before but as it could only be used on open workbooks was never really of any use.

    I have attached an example sheet though the actual sheet is considerably larger than this. The data sheet is actually in a completely different workbook from the filtered report. The Data sheet contains lots of lines with data which is of no use but in the same format. This is why I am using the Index function to identify the data that I need.

    However because each line of reported data includes the hole title in 2 places the index function required a second parametre to identify the correct line to pull the information from.This was the Axis which is nicely always in the same Column.

    All Files are kept in the same Folder but each File has a different name.Example Data Report.xlsx
    Last edited by Laura_93; 01-12-2015 at 01:17 PM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,603

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    Yup. sorry... INDIRECT.EXT is what you need. Its syntax makes it a bit clunky to set up, but it does work a treat.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    You can find the Morefunc.xll add-in here:

    http://www.ashishmathur.com/tag/morefunc/

    I use it in 32bit Excel 2002 and 2007. I don't think it works in 64bit Excel.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,603

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    I have it working in Excel 2010, but you need t move some files around. Ashish Mathur put up an article about it
    http://www.ashishmathur.com/extract-...d-excel-files/

    i used the same workaround on Excel 2013 on a very puny Asus notebook, but I haven't had any need to use it yet...

  8. #8
    Registered User
    Join Date
    01-12-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    6

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    Hi again,
    How did you manage to get it to work? I am trying to get the Indirect.EXT formula to work within an Index formula. Where the Indirect.ext formula has a concatenate within it to specify the file path and cell range. To come up with a faster way of processing the data making it as easy as possible I have the File Path in Cell D2 and then the variety of ranges in columns B to N in a row range of 1:2500.

    =INDEX((INDIRECT.EXT(CONCATENATE(D2,D5),MATCH(1,($A7=(INDIRECT.EXT(CONCATENATE(D2,D4)))*($E7=(INDIRECT.EXT(CONCATENATE(D2,D7))),0))))))

    This is what I am trying atm but the formula says it is input incorrectly or there are missing bits.

    I'm new to this formula so I don't know how to get it to work.

  9. #9
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    I'll try to use Morefunc.xll, but when the file open on other computer the function not work, I think it need to be install on that computer too.

    So make sure about that if you want to use Morefunc.xll and share with others.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,603

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    You're not using INDIRECT.EXT correctly. Unfortuinately, I'll be away for about 2-3 hours. if no-one has replied by then - i'll sort it out for you.

  11. #11
    Registered User
    Join Date
    01-12-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    6

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    I know each computer wanting to use the sheets will need Morefunc.xll, this will be sorted out. I just need to get the thing to work first.

  12. #12
    Registered User
    Join Date
    01-12-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    6

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    And I think I know why it may not be working but I really don't want to have to specify every single file path with sheet name and the cell range it needs to pick up. Then insert that into roughly 2500 cells. And there are 60 of these 2500 cell sheets that will need filling in. Which then connect to a summary sheet with 65 columns and 500 rows long.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,603

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    Drag these two onto the desktop. Open target. Adjust the formula in C2 in two places to reflect YOUR situation on your PC in respect of the bit in bold in E-G. Put any number between 1 and 5 into B2. Watch. then open Fred.xlsx to check. Adapt the syntax to your EXACT requirements.

    Any problems, shout...
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    01-12-2015
    Location
    England
    MS-Off Ver
    2007
    Posts
    6

    Re: Help with formula to pick up a file path to a workbook from a cell in the same workshe

    Hi again,
    Thanks for the response but the formula is missing the comparative Match. As each particular hole has a title line and then data lines with each one having exactly the same hole name in the same column it needs to have a second parameter to match against. However for now I have just done it the slightly longer way and changed the settings to automatically pick up links which are added so it doesn't have to confirm itself every time I paste it. And picks up new filenames when I put them in quite nicely. Though it takes longer to do it seems to work well for what I need so I will stick with that for now. Though I will see if that Indirect.EXT formula will be useful in the future.

+ 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. Save a Workbook With A file path and name referenced cell
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-19-2013, 06:39 AM
  2. [SOLVED] Copy worksheet from outside workbook using path located in cell
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-16-2013, 12:04 PM
  3. Replies: 5
    Last Post: 03-21-2013, 07:34 AM
  4. Using a cell reference as a file path to a workbook
    By SandyUK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2012, 02:45 PM
  5. dialog box to pick path & file
    By dlh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2005, 12:05 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