+ Reply to Thread
Results 1 to 26 of 26

How to fetch a cell from a different excel file, which is closed & in a different folder

  1. #1
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    How to fetch a cell from a different excel file, which is closed & in a different folder

    Hello everyone!

    This forum is great and I used it several times already! I hope you guys can help me with my problem. I will try and describe it as clearly as I can and what I need to achieve:

    I have ONE excel file (lets call it MAIN.XLS). I use this excel file to create and list products for an ecommerce website. It’s a very simple sheet with some vlookup function. Nothing special really. You can consider it as a template of some sort.

    Now, we have 2,000 different folders and inside each folder we have one .CSV file. Inside each .CSV file we have 6 cells with some numbers/data (different data for each file). The filename of the .CSV is the same on all folders (Data.csv) and the layout is also the same on all all files.

    Before I will continue, its important to mention that I will copy the main template file (MAIN.XLS) to each for the folders in order for what I will write below will work.

    Ok, now what I wanted to achieve was something simple, or so I thought – take the main file MAIN.XLS and on cell A7, I wanted to take data from cell A2 from the .CSV file (=[Data.csv]Data!$A$2). The problem its not working on other folders. My guess was because the link is broken due to location of file.

    I have searched around and found that there is a formula for a file location - =LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1) – so if I insert this formula it should give me the same folder as the .csv file (since I put both files on same folder). However it did not worked.

    My English is not very good so I hope I explained it fine. If not clear please tell me and I will do my best to try and explain it again.

    Thanks again for all the help!

    Mod Edit: OP has redefined the issue with a new attachment in post #25.
    Last edited by AliGW; 02-19-2019 at 12:00 PM.

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

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Welcome to the forum!

    Please fill in your Office version and location (UK, USA, etc.) in your user profile as these are important for helpers to know when tailoring suggestions to your locale and Office version.
    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 Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Advice to work in one folder, instead of multiple folders.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  4. #4
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Thanks for the reply! I have updated my profile and I also want to mention I am using a Mac.

    Second, its not possible to work in one folder. From several different reasons it must work as I described above.

    Looking for a solution!

    Thanks!

  5. #5
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    any idea guys? is it really that complicated or not possible even?

    Thanks!

  6. #6
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Attach your main worksheet as well as two three supported files which is in different folders. With mentioning enter manually expected result in respective cells.

  7. #7
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Thank you very much for the reply. My english is not very good. can you please try and explain it again maybe even with an example how I can do it on my excel?

    Thanks again!! Still have hope to solve this problem!
    Last edited by AliGW; 02-19-2019 at 04:27 AM.

  8. #8
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    You are being asked to provide your workbooks. You can attach them here. Make sure you desensitise them first.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  9. #9
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Oh, no problem!

    Please check the attachments including an example of how it should work / what I need:

    So the filename “MAIN.xlsx” is the main template file. I want to create a formula on A2, so when I will copy this template file (“MAIN.xlsx”) into all of the data folders, then it will fetch the cell A2 from the DATA.xlsx within the same folder. I hope that explains it a bit better!

    When I tried to do that the link was broken, and every time I opened the MAIN.xlsx it gave me all sorts of errors telling me the location of file is different, or update link (which did not worked). The logical solution, at least the way I see it, since I copy the MAIX.xlsx to each folder, we can use this formula =LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1), which give us the location of the file, and since both files names (MAIN.xlsx and DATA.xlsx) are on same folder, it should work, but it didn’t

    Thanks again for all the help!
    Attached Images Attached Images
    Attached Files Attached Files

  10. #10
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    There is no data in the sample files - we need to be able to see what you are trying to do here.

  11. #11
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    I did put data on file excel files. On filename DATA.xlsx on line A2, there is a text (TEXT 1). Imagine that on the other data folder, the text is different (like TEXT 2). I simply need to create one formula on the main file (MAIN.xlsx) so that when I copy this file to each folder, it will fetch A2 from the DATA.xlsx. So for folder one for example, it will show TEXT 1 on A2 on MAIN.xlsx.

    That is really all I'm looking to get.

    Thanks!

  12. #12
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    OK - thanks for the clarification.

  13. #13
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    I hope now all is clear! My english not very good so a bit hard to explain it.

    Thanks again and hopefully a solution is near!

  14. #14
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Be patient - the volunteers here will look at the problem when they are ready. Your English is not so bad!

  15. #15
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Kindly attach file with your formula's. Input some more data.

  16. #16
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Quote Originally Posted by avk View Post
    Kindly attach file with your formula's. Input some more data.
    I did attach my files (see post #9) - I wasn't able to get this to work. Tried all sorts of things but I don't have a formula. So right now if you open MAIN.xlsx, then in A2 we should have a formula to fetch the cell A2 from DATA.xlsx, but its empty as nothing I did worked. That is where I hope you can help me.

    This formula - =LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1) - will get you the file location on pc. since we are putting both files on the same folder I was thinking it may help us for a possible solution.

    Thanks.

  17. #17
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Have you considered Power Query for this?

    I am not really clear what the purpose is: if you could explain the ultimate goal, it might make it easier to help. Why do you need to do this?

  18. #18
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    I’m not sure what Power Query is or how to use it.

    Well, the purpose of this is this – the MAIN excel file is acting a main template to list products to a website. I just fill the text and numbers to this excel sheet and the product listing is complete. for example, product title, category, price, etc. just simple attributes.

    Now, each of the folders with DATA files contain the text/data needed to list each product. Instead of having to open each time the data.xlsx files and then copy the data into the main excel template, then save it again as different name and put into different folder, I was thinking just create a simple formula to one file (the main excel file) that will fetch the data needed automatically from the folder we copy this file to. I was thinking it’s a very simple solution and also would be very easy to make but seems pretty complicated?

    Thanks!
    Last edited by AliGW; 02-19-2019 at 07:05 AM.

  19. #19
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    So use Power Query (Get & Transform on the Data Ribbon).

    In the source document, establish the master document as the data source (Data > Get Data > From File ...).

  20. #20
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    I tired to search where it is as I was not able to locate it. After some google search, this feature is not available for Mac users.
    Last edited by AliGW; 02-19-2019 at 06:55 AM.

  21. #21
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Please update your forum profile to include Mac in your Office version. It will prevent people from wasting their own time and yours. Thanks.

  22. #22
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    OK. I just update it. hoping this can be achieved with some formula or even macro.

  23. #23
    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,460

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    Thanks.

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

  24. #24
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Re: How to fetch a cell from a different excel file, which is located on a different folde

    No problem. Noted.

    Also, after some testing I think I maybe close to find out the solution but I don’t have the know-how to properly do it;

    I put both files on same folder. For the MAIN template file I insert on B1 this formula: =LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1)&"DATA.xlsx", which gives me the location and filename for the data excel file. On A2 (which is the cell I want to show the info I fetch from the different workbook, DATA.xlsx) I put =TRIM([B1]DATA!A2), of course this doesn’t work and ask me to choose the file, then it works, but maybe something like this should work. I simply don’t have the expertise to correct this formula but all missing pieces are here.

    Thanks!
    Last edited by excelgeek9; 02-19-2019 at 09:34 AM.

  25. #25
    Registered User
    Join Date
    10-15-2014
    Location
    Serbia
    MS-Off Ver
    Office 2015 - Mac (15.13.3)
    Posts
    13

    Copy a cell from a different excel file (while closed). SEEMS DIFFICULT

    Hello everyone!

    I really hope you guys can help me as I’m getting very desperate and can’t seem to find a solution to my problem. I even opened a similar thread the other day on the Formulas & Functions but later came to an understating that what I asked cannot be achieve with formulas but macros and code. OK, here is my problem and what I need:

    I have one main excel file (MAIN.xlsx), which I use as a template to list products to an ecommerce website. I simply fill the different cells with text / numbers (like product name, category, price, etc) and then upload it to our system. Very simple.

    Now, we have around 1,000 different folders that contain important information about new products. In each of these folders we have one excel file (name DATA.xlsx – same name and layout on all folders) that contain a cell with different text.

    What I wanted to do, is create a simple formula in the main template file (MAIN.xlsx), copy this file to each of the datas folder, and then once I open it, it would be able to fetch that cell from the data file. After much research I even thought of a possible solution:

    Since we are getting both files at the same folder, we can use this function: =LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1)&"DATA.xlsx" , which will bring us the full file pathname of the DATA.xlsx. Then it would be easy to copy the cell we want. HOWEVER it did not worked and as I have very little knowledge I then understood its not possible.

    Please check the attachment for an example as to what I need and I pray that someone can help me here!

    Thanks for your time!
    Attached Files Attached Files

  26. #26
    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,460

    Re: Copy a cell from a different excel file (while closed). SEEMS DIFFICULT

    Threads merged and moved to the VBA section. I have also amended the original title.
    Last edited by AliGW; 02-19-2019 at 11:56 AM.

+ 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. appending a text file from the same folder where excel file is located
    By np1966 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2017, 10:11 PM
  2. VBA-print as pdf w/ filename from a cell, & print in folder excel file is located
    By wpssnotoq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2017, 06:43 PM
  3. Replies: 1
    Last Post: 09-22-2015, 02:22 PM
  4. [SOLVED] Lookup folder from cell text, then save excel file in this folder
    By dodgybob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2014, 09:00 AM
  5. Reduce processing time for saving excel sheets located in a folder
    By rexer231 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2014, 05:28 AM
  6. Replies: 9
    Last Post: 04-18-2012, 08:50 AM
  7. Replies: 2
    Last Post: 03-26-2012, 07:12 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