Fix an INDIRECT Formula in Excel 2016 for Mac
Question details
The user needs an INDIRECT formula that combines a sheet name with cell addresses stored in other cells and evaluates instead of appearing as text.

- Product
- Microsoft Excel 2016 for Mac
- Device & OS
- Mac
- Scenario
- O2 contains a sheet name, D2 contains B12, and E2 contains C12. The user wants to compare J2 with the first referenced cell and return the second cell's contents when they match.
- Observed behavior
- The formula appears as text in the cell, and the references are not resolved.
Check that O2 contains the sheet name without surrounding quotation marks and that D2 and E2 contain valid cell addresses such as B12 and C12. Confirm that the named worksheet exists in the same workbook.
Build the INDIRECT references from the cell values
Use this formula to compare J2 with the cell named in D2 and return the cell named in E2 when they match.
The sheet name and address must be joined with an exclamation mark. Single quotes around the sheet name support names containing spaces; SUBSTITUTE also handles apostrophes in the name.
Click the cell where you want the comparison result to appear.
Type =IF($J$2=INDIRECT("'"&SUBSTITUTE(O2,"'","''")&"'!"&D2),INDIRECT("'"&SUBSTITUTE(O2,"'","''")&"'!"&E2),"") and press Return.
With O2 set to Sheet Name, D2 to B12, and E2 to C12, check that the result cell displays the contents of 'Sheet Name'!C12 when J2 matches 'Sheet Name'!B12.

Stop Excel from displaying the formula as text
Use these checks if the formula itself remains visible instead of calculating.
Build the Same INDIRECT Formula in WPS Spreadsheets
Use WPS Spreadsheets to combine a worksheet name and cell addresses with INDIRECT, then compare and return values from the referenced sheet.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Check the source cells: Confirm that O2 contains the worksheet name and that D2 and E2 contain the cell addresses to compare and return.
- 3. Enter the formula: Select the result cell, enter =IF($J$2=INDIRECT("'"&SUBSTITUTE(O2,"'","''")&"'!"&D2),INDIRECT("'"&SUBSTITUTE(O2,"'","''")&"'!"&E2),"") and press Enter.
- 4. Save the workbook: Use File > Save As to save the workbook in Excel XLSX format.

Frequently Asked Questions
Why does INDIRECT need an exclamation mark?
The exclamation mark separates the worksheet name from the cell address. Join O2, "!", and D2 to construct a reference such as 'Sheet Name'!B12.
How do I reference a sheet name containing spaces?
Enclose the sheet name in single quotes when constructing the reference. For a name in O2 and an address in D2, use INDIRECT("'"&SUBSTITUTE(O2,"'","''")&"'!"&D2).
Why does Excel show my formula instead of its result?
The cell may be formatted as Text, the formula may have a leading apostrophe, or Show Formulas may be enabled. Change the format to General on the Home tab, re-enter the formula, and check Formulas > Show Formulas.
What does the formula return if J2 does not match the referenced cell?
The formula shown returns an empty string because its final IF argument is "". Replace that argument with a message or value if you want to show something else.




