HELP ON REFERENCING ANOTHER WORKBOOK

Copper Contributor

I wonder if anyone can help me.  I understand how to reference another workbook.  However I am wanting to link another wookbook where the workbook name is quoted in the current sheet.  

I.E =[WK01.xlsx]Sheet1!$A$1

However i am wanting to automatically get [workbook name] from column A

 

workbookEARNINGS
 MONTUESWEDTHURSFRI
WK01£150.00    
WK02     
WK3     
WK4     
WK5      
WK6     
WK7     
WK8     
WK9     
WK10     

 

Thanks in advance

11 Replies

@LEE_STEWART 

You might use the INDIRECT function for this, but that only works if the workbook referred to is open in Excel, so you'd have to keep WK01.xlsx to WK10.xlsx open.

Let's say WK01 is in cell A3.

The formula in B3 could look like this:

 

=INDIRECT("'["&A3&".xlsx]Sheet1'!A1")

 

This can be filled down.

@LEE_STEWART 

 

I agree with the advice given by @Hans Vogelaar 

 

Here's a reference that may give further guidance on the use of INDIRECT: https://exceljet.net/formula/indirect-named-range-different-sheet

 

@Hans Vogelaar 

 

ok thankyou,  is there a way to do something similar where the wookbooks didn't have to be open.  As this would progress to 52 weeks over the course of the year and thats a lot off wookbooks to have open at any one time just to compare and add up over the course of the year?

@LEE_STEWART 

 

You haven't said exactly how large those weekly workbooks are, how many distinct spreadsheets there are in each weekly workbook.

 

So let me ask a question of two:

  1. would it be possible to combine them as separate sheets all in the same workbook?
  2. might it even be possible to combine all of the data into a single data table (using column headings to differentiate days or weeks)?

 

It's been my observations that many people manually separate the raw data (the input end of things) into days or weeks for clarity at the front end. Excel is really good (it "excels") in taking a single database (a.k.a. Table) and summarizing it, breaking it apart as needed for detail output reports, tabulating things.

 

The Pivot Table is but one example of that....your summary presentation could easily be produced if all that data were in a single table to begin with, letting Excel do the heavy lifting of producing the summary numbers by day and week.

@LEE_STEWART 

You may check this Referencing value in a closed Excel workbook using INDIRECT? if something will help, I didn't test what is suggested in it. 

@mathetes 

each workbook/week is 78kb  each day has its own sheet that calculates what I have earned depending on multiple factors with a summary/total sheet at the end. There's then other sheets with references to pay rates drop down boxes and other sheets that determine variables on pay scales depending on certain circumstances.

 

This has all worked really well so far.  I am now wanting another workbook where I can compare analyse these weeks in one place. 

@LEE_STEWART 

Another option could be Power Query, but that's rebuild the model from scratch.

@LEE_STEWART 

 

You wrote:

 

each workbook/week is 78kb each day has its own sheet that calculates what I have earned depending on multiple factors with a summary/total sheet at the end. There's then other sheets with references to pay rates drop down boxes and other sheets that determine variables on pay scales depending on certain circumstances.

 

This has all worked really well so far. I am now wanting another workbook where I can compare analyse these weeks in one place.

 

Which basically supports my thesis: you're doing the heavy lifting by separating everything as you've done it, making it harder for Excel now to do this big picture analyses.

 

It would, as @Sergei Baklan correctly points out, require a total redesign to make it into a single database--but doing that would provide maximum flexibility: you'd then be able to continue doing your daily and weekly summaries as well as the big picture stuff.

@mathetes  ok thankyou.  Not the end to this story I was expecting but take your advise on board.  Looks like I have a lot off work to re-do this.  The reason I guess I have ended up in this position is it has evolved over time.  To me wanting a quicker way to calculate what I earned in a day which is complicated in itself.  To then keeping a weekly copy of it too check my payslip when I get it a fortnight later to now thinking it'll be good to see this information for the year in one place.  

 

If I understand you correctly.  I need to move to one sheet = 1 week.  Therefore 52 sheets for the year with the summary on the 53rd sheet. which will require the wages calculation to appear 5 times on one sheet.

20201129_135122.jpg

 

@LEE_STEWART 

If I understand you correctly. I need to move to one sheet = 1 week. Therefore 52 sheets for the year with the summary on the 53rd sheet. which will require the wages calculation to appear 5 times on one sheet.

 

No. Simpler than that. Move to one sheet. Full stop.

 

One sheet that contains the raw data. Then learn how to use Excel's many features--I've mentioned the Pivot Table, @Sergei Baklan has referred to Power Query--but learn to use Excel's many features that can take extensive raw data and produce detailed summaries at whatever level of specificity you want.

  • Daily reports for specified days.
  • Weekly reports
  • Annual
  • Comparisons between days, weeks, years
  • Do we need to mention months?

 

By storing your raw data in daily sheets, you're producing one level of that but making all the others harder to do, since you then need to make the kind of cross workbook links you opened this thread talking about.

 

Your screen image shows part of the problem, in that you've made it, to a certain extent, a work of art, using colors and nice headings, etc., etc. That happens often, and it often happens as you say, it grows up over time.

 

Let the raw data be just that, raw data. Let your output reports be where you pretty things up.

 

There are YouTube videos and other resources here on Microsoft's website that can all help....look for help constructing what are called "Dashboards"--they generally are ways of producing useful summaries, working from collections of raw data.

 

And you can always get help here. You could begin by posting not just an image but some representative samples of your daily/weekly sheets. We could illustrate how a single data table could be constructed using that data. Maybe you should aim at implementing the new approach in 2021.

 

 

 

 

@LEE_STEWART 

 

Let me offer a bit more of an explanation to my last post. I know it sounds like, potentially, a lot of work to now consolidate weeks or days worth of separate spreadsheets into a single database. So let me offer a bit of my own reasoning. I have come to this from a career (retired now) that included not only a lot of spreadsheets but also a role as director of a major corporation's HR and Payroll database. I have quite a bit of experience taking separate data tables and combining them to produce useful reports. I also have experience taking single tables in Excel and extracting data to produce useful summary reports.

 

Excel is a very powerful tool for analyzing data. Unfortunately, it is quite common for people to do what you've done here, which is to start at the lower level with daily or weekly sheets that summarize sales/orders/purchases/production at that daily or weekly level. Often these sheets are essentially little more than automated copies of the kinds of records that previously were kept in paper ledger sheets. It is true that Excel can work to pull together multiple sheets into a single report. You were starting with one method of doing that. Reference has also been made to Power Query, which is, as the label implies, a powerful way to query multiple tables, joining them so as to produce useful reports. It's quite comparable to what I used to do with the HR/Payroll database at my company, where SQL (Structured Query Language) enabled us to produce reports that joined tens of separate data tables into a single "virtual table" for a variety of purposes.

 

Excel can do that.

 

Excel also has a number of tools that can take a single data table, a table that consolidates years worth of daily data, say, and extract and summarize very focused subsets of the whole. I've already mentioned the Pivot Table, which many find to be adequate for most such analyses. There are also both menu items and, recently a function for FILTERing or SORTing selected data. Coupled with other functions such as MIN and MAX, AVERAGE, etc., etc., there truly is a wide array of summary reports that are readily produced from a single database that contains all the micro-level ("highly granular" is the way a lot of data geeks refer to it) details.

 

And the reality is that it's easier and more flexible to use Excel's abilities to focus and extract, to filter, to cross-tabulate, from a single database, than it is to take a host of separate spreadsheets and combine them (via Power Query) so as to do that same cross-tabulation. It's one thing if all you're combining are, say, three or four separate workbooks, but when your source data for a year has been captured in 52 separate workbooks, then it becomes quite unwieldly. Possible, but unwieldly.