How to Consolidate Data from Future Invoice Sheets in Excel
Question details
The user needs to consolidate specific expense ranges (vehicle, fuel, general) from multiple invoice worksheets that are created and renamed dynamically over time.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- An accountant needs to combine specific cell ranges from various invoice sheets into a single summary worksheet, using a tracking list of future sheet names, to avoid manually inspecting every invoice.
- Observed behavior
- Standard formulas cannot directly retrieve data from worksheets that do not yet exist, returning errors unless the sheets are created first or a dynamic approach is used.
Ensure that all your future invoice worksheets will follow the exact same structural layout (e.g., A118:AF142 for vehicles) and that you maintain an accurate list of upcoming sheet names in your master tracking sheet.
Use Power Query to Append Data from Multiple Sheets
Power Query is the most robust method to automatically consolidate data from multiple worksheets, even as new invoice sheets are added to the workbook over time.
Power Query can extract data from all sheets within a workbook and append them together. When new invoice sheets are created, you simply refresh the query to include the new data in your summary.
Go to the Data tab, click on 'Get Data' > 'From File' > 'From Workbook', and select your current Excel file.
In the Navigator window, select the workbook folder (instead of individual sheets) and click 'Transform Data'.
In the Power Query Editor, click the drop-down on the 'Name' column to uncheck any summary or tracking sheets, leaving only the invoice sheets.
Click the expand icon (two outward arrows) on the 'Data' column to combine the contents. Apply filters to keep only the rows corresponding to your specific expense ranges.
Click 'Close & Load' to output the combined data to your summary worksheet. When future sheets are added, right-click the resulting table and select 'Refresh'.

Use the INDIRECT Function with a Sheet Tracking List
Use the INDIRECT formula to dynamically pull data using the list of expected future sheet names, allowing the summary sheet to populate automatically once the sheets are created.
Automate Consolidation Using a VBA Macro
A VBA script can be configured to loop through the invoice-tracking list and copy specific ranges to the summary sheet with a single click.
Consolidate Invoice Data Seamlessly with WPS Spreadsheet
WPS Spreadsheet provides powerful data consolidation tools, comprehensive formula support including INDIRECT, and robust macro compatibility, making it incredibly easy to summarize multiple dynamic invoice sheets.
- 1. Prepare Your Master Sheet: Open your workbook in WPS Spreadsheet and create a master sheet containing your invoice-tracking list (A8:A107).
- 2. Apply Dynamic Formulas: Use the standard INDIRECT function to reference your tracking list, instantly pulling data from existing invoice sheets.
- 3. Use Data Consolidation: Alternatively, go to the Data tab and use the 'Consolidate' feature to combine fixed ranges from multiple open worksheets quickly.

Frequently Asked Questions
Why does my formula return a #REF! error when pointing to future sheets?
Formulas like INDIRECT require the target worksheet to exist and be open. If the invoice sheet listed in your tracking list hasn't been created yet, the software cannot resolve the reference, causing a #REF! error. Wrapping your formula in IFERROR can hide this until the sheet is generated.
Can I consolidate non-contiguous ranges like A118:AF142 and A155:AT178 at the same time?
Yes, but you cannot do it as a single block reference. You must set up separate queries in Power Query for each range, use separate INDIRECT formulas for the different blocks, or specify the different ranges individually within a VBA macro.
Is there a way to automatically generate the future invoice sheets from my tracking list?
Yes. You can use a VBA macro to automatically create a new worksheet for every name listed in your tracking range (A8:A107). Alternatively, you can create a PivotTable from your list and use the 'Show Report Filter Pages' option to generate multiple sheets instantly.




