logo
search
Function Problems

How to Copy Excel Formulas Referencing the Previous Worksheet

WPS EditorWPS Editor Oct 8, 2026 870 views

Question details

The user needs to copy monthly Excel formulas into a new worksheet so that they automatically reference data from the previous month's worksheet, avoiding the need to manually edit sheet names in every formula.

How to Copy Excel Formulas While Referencing the Previous Worksheet
Product
Excel
Device & OS
not provided
Scenario
Creating monthly tracking reports where each new month requires formulas to pull baseline data or compare values from the immediately preceding month's sheet.
Observed behavior
When copying formulas from one sheet to another, Excel does not automatically update the sheet name references (e.g., a formula referencing 'JAN' will still reference 'JAN' when copied to the 'MAR' sheet).
Before you start

Verify that your monthly worksheets follow a consistent naming convention (such as JAN, FEB, MAR) and that the referenced data is located in the exact same cell addresses across all sheets.

Solution 1Recommended

Use the INDIRECT Function for Dynamic Sheet Referencing

Generate worksheet names dynamically by referencing a helper cell that contains the name of the previous month.

The INDIRECT function converts a text string into a valid cell reference. By combining text strings and cell values, you can change the referenced sheet name simply by updating a single cell in your current worksheet, rather than rewriting the formula.

1
Set up a helper cell

In your new worksheet (e.g., the MAR sheet), type the name of the previous month's sheet (e.g., FEB) into an unused cell, such as A1.

2
Select the target cell

Click on the cell where you want to perform the calculation or data pull.

3
Construct the INDIRECT formula

Enter the formula using INDIRECT to build the reference. Type: =INDIRECT("'"&A1&"'!$D$31"). This tells Excel to look for cell D31 inside the sheet named in A1.

4
Incorporate your logic

If you are using IF statements or other logic, nest the INDIRECT function inside it. For example: =IF(INDIRECT("'"&A1&"'!$D$31")>0, INDIRECT("'"&A1&"'!$D$31"), -INDIRECT("'"&A1&"'!$D$31")).

5
Apply and test

Press Enter to apply the formula. Whenever you copy this sheet for a new month, you only need to change the text in cell A1 to update all dependent formulas instantly.

Use the INDIRECT Function for Dynamic Sheet Referencing
Locking Cell References: Typing absolute references like $D$31 within the text string ensures the target cell does not shift when you copy the INDIRECT formula to other locations in your current sheet.
Cross-Sheet Formula Management

Easily Manage Multi-Sheet Data with WPS Office

WPS Spreadsheet makes it simple to manage complex, multi-sheet workbooks. You can seamlessly use advanced functions like INDIRECT and cross-sheet references to build automated monthly reports with ease.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your monthly tracking workbook.
  2. 2. Input the reference text: Type the target sheet name in a helper cell, such as A1, on your new monthly sheet.
  3. 3. Apply the INDIRECT function: Use the =INDIRECT("'"&A1&"'!$D$31") formula syntax to reference the previous sheet dynamically.
  4. 4. Calculate instantly: Press Enter to instantly fetch and calculate your data across worksheets.
Fully compatible with Microsoft Excel formulas, including INDIRECT and IF functions.Lightweight software that opens large, multi-sheet workbooks instantly.Advanced Find and Replace features for quick formula adjustments across multiple ranges.
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get a #REF! error when using the INDIRECT function?

A #REF! error typically occurs if the sheet name you are referencing is spelled incorrectly, contains spaces but isn't enclosed in single quotation marks within the formula string, or if the referenced worksheet has been deleted or renamed.

How can I copy the exact formula without changing cell references?

To copy a formula exactly as it is without Excel adjusting the relative cell references, click into the Formula Bar, highlight the text, press Ctrl+C, press Esc to exit the cell, and then paste the text directly into the target cell. Alternatively, use absolute references (like $A$1) before copying.

Can Excel automatically get the previous sheet's name without typing it in a cell?

Excel does not have a built-in function to dynamically grab the 'previous' sheet purely based on its physical tab order. To achieve this automatically without a helper cell, you would need to write and implement a custom VBA macro to determine the sheet index and fetch its name.