Excel dynamic worksheet or workbook reference
Supposing you have data with the same format across multiple worksheets or workbooks and need to get data from these worksheets or workbooks dynamically into another sheet. The INDIRECT function can help you quickly get it done.
Supposing there are four worksheets containing different sales in quarters for four salesmen, and you want to create a summary worksheet to dynamically pull the quarter sales based on the corresponding salesman. To make it work, the below formula can help.
1. As the below screenshot shown, firstly, you need to create the summary worksheet by entering the sheet names separately in different cells, then select a blank cell, copy the below formula into it and press the Enter key.
Notes: In the code:
- B3 is the cell containing the sheet name you will pull data from;
- C3 is the cell address in the specific worksheet you will pull its data;
- To prevent returning the error value if either B5 (the sheet name cell) or C3 (the cell you will pull the data) is empty, please enclose the INDIRECT formula with an IF function displaying as below:
- If there are no spaces in your sheet names, you can directly use this formula
2. Then, drag its Fill Handle down to apply the formula to other cells. Now you have returned all sales of the first quarter from the specific worksheets.
3. Go ahead to pull all sales of other quarters as you need. And don’t forget to change the cell reference in the formula.
This section is talking about dynamically referencing cells in another workbook in Excel.
As the below screenshot shown, The data you want to return locating in column E of worksheet “Total sales” in a separate workbook named “SalesFile”. Please do as follows step by step to get it done.
1. Firstly, let’s fill in the workbook information (including the workbook name, worksheet name, and reference cells), which you will pull data based on this information into current workbook.
2. Select a blank cell, copy the below formula into it and press the Enter key.
- B3 contains the workbook name where you want to extract the data from;
- C3 is the sheet name;
- D3 is the cell you will pull data from;
- The #REF! error value will return if the referenced workbook is closed;
- To avoid the #REF! error value, please enclose the INDIRECT formula with the IFERROR function as follows:
3. Then drag the Fill Handle down to apply the formula to other cells.
Tip: If you don’t want the return value turning to be error after closing the referenced workbook, you can directly specify the workbook name, worksheet name and the cell address in the formula as this:
The Best Office Productivity Tools
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 6 months agoplease get back with me. it's been a while since i used cel references. what i want to do is from a column of entires, i wish to make a new column and grab every 100th row of the prior column. let's say i have cells filled in F3, F103, F203...i want the contents to appear in G3,G4,G5. it doesn't work to say =(F3+100*counter) with having a counter in a column next to where i am having the formula.