How to Fix Excel INDEX Formula Returning Zero Due to Circular Reference
Question details
The user needs to resolve an issue where an INDEX formula returns 0 instead of the expected value because of a circular reference.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Using the INDEX function combined with dynamic counters like COUNT in a spreadsheet.
- Observed behavior
- The formula returns 0 because it inadvertently refers to its own cell, causing a circular reference loop that halts normal calculation.
Before modifying your formula, check the bottom-left corner of your Excel window for a 'Circular Reference' warning, which indicates exactly which cell is causing the calculation loop.
Replace the Circular COUNT Function with a COLUMN-Based Counter
The most reliable way to fix the circular reference is to adjust the logic of your formula so it no longer references its own output cell.
When using dynamic ranges inside an INDEX formula, functions like COUNT can accidentally include the cell where the formula resides. Replacing this with a spatial calculation using the COLUMN function prevents the loop while maintaining the dynamic counting behavior.
Select the cell containing the INDEX function that is currently returning 0.
Look at the formula bar and find the dynamic counter, such as COUNT($M$20:M20), which is causing the circular reference.
Replace the COUNT segment with COLUMN(M20)-COLUMN($M$20)+1. This calculates the relative position without referencing the cell's own value.
Press Enter to apply the updated formula. If needed, drag the fill handle to apply the corrected formula across your intended range.

Enable Iterative Calculation in Excel Options
If your workflow requires intentional circular references, you can force Excel to calculate them up to a specific number of times.
Fix Circular References and Complex Formulas in WPS Spreadsheet
WPS Spreadsheet offers full support for advanced functions like INDEX, MATCH, and COLUMN. It also provides clear error tracing tools to help you quickly identify and resolve circular references in your data.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open the spreadsheet containing the formula error.
- 2. Locate circular references: Go to the 'Formulas' tab and click 'Error Checking' to easily spot cells causing a circular reference loop.
- 3. Edit the formula: Click the formula bar to replace the self-referencing COUNT function with the COLUMN function method.
- 4. Adjust calculation settings if needed: Alternatively, navigate to Menu > Options > Calculation to enable iterative calculation for intentional loops.

Frequently Asked Questions
What is a circular reference in a spreadsheet?
A circular reference occurs when a formula directly or indirectly refers to its own cell. This creates an infinite loop, causing the software to stop calculating the cell and often return a 0 to prevent crashes.
How do I find hidden circular references in my workbook?
Go to the 'Formulas' tab, click the arrow next to 'Error Checking', and select 'Circular References'. This will display a list of specific cells that are causing the infinite loop.
Why does my INDEX formula return 0 instead of a standard error?
When a circular reference is detected, the calculation engine halts the process for that specific cell to prevent an infinite loop. As a result, it defaults the cell's output value to 0 rather than displaying a standard #VALUE! or #REF! error.
Is it safe to enable iterative calculation to fix this?
While it resolves the immediate 0 output, enabling iterative calculation can mask other accidental circular references in your workbook. It is generally safer to correct the formula logic unless your specific model strictly requires intentional loops.




