Formula Errors

How to Reference Values from Merged Cells in Excel Formulas

Muhammad TalhaMuhammad Talha Oct 29, 2026 868 views

Question details

The user needs to reference data contained within a merged cell range in formulas, but only the first cell returns a value while the rest return blank.

How to Reference Values from Merged Cells in Excel Formulas
Product
Microsoft Excel
Device & OS
not provided
Scenario
Calculating totals or looking up data using functions like SUMIFS or VLOOKUP based on categories that are vertically grouped using merged cells.
Observed behavior
Formulas referencing the merged range fail for all rows except the first one because only the upper-left cell of a merged block contains the data, leaving the rest empty.
Before you start

Before applying formulas, evaluate if merged cells are strictly necessary for your data table layout, as unmerging cells and repeating labels is often the cleanest approach for data analysis and prevents formula errors.

Solution 1Recommended

Use a Helper Column with an IF Formula

Create a new column to automatically fill down the category values from the merged cells, which can then be used reliably in your calculation formulas.

When cells are vertically merged, Excel only stores the actual data in the top-left cell of the merged range. Subsequent underlying cells are treated as blank, which breaks lookup and aggregation functions.

A helper column bypasses this limitation by using a logical IF function to conditionally copy the category name down to every row.

1
Insert a helper column

Insert a new column directly next to your merged category column. For example, insert Column D to act as the helper for the merged Category Column A.

2
Reference the first cell

In the first data row of the helper column (e.g., cell D2), reference the top-left cell of your merged data directly by typing `=A2`.

3
Apply the IF function

In the next row down (e.g., cell D3), enter the formula `=IF(A3="",D2,A3)`. This tells the spreadsheet to check if the adjacent cell is blank (which happens if it is part of a merge) and pulls the value from the row above if true.

4
Fill down the formula

Select cell D3 and drag the fill handle down to copy this formula to the rest of your data rows. The column will now display the category name for every single row.

5
Update your final formulas

Modify your primary calculation formulas, such as VLOOKUP or SUMIFS, to reference this new helper column instead of the original merged column.

Use a Helper Column with an IF Formula
Pro Tip: Once your helper column is set up and your formulas are working properly, you can hide the helper column to maintain a clean spreadsheet layout while keeping your calculations fully functional.
Effortless Spreadsheet Management

Fix Merged Cell Formula Errors Easily with WPS Spreadsheet

WPS Spreadsheet provides a robust and highly compatible environment for data analysis, supporting all standard Excel formulas, including IF, VLOOKUP, and SUMIFS. Handle complex data formatting and merged cell calculations seamlessly.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your merged data.
  2. 2. Insert helper column: Right-click the column header next to your merged data and choose 'Insert Column'.
  3. 3. Apply IF logic: Use the IF function logic (e.g., `=IF(A3="",D2,A3)`) to populate the blank underlying cells automatically.
  4. 4. Calculate accurately: Apply your final SUMIFS or lookup formulas referencing the newly created continuous data column.
100% compatibility with Microsoft Excel formats (.xlsx, .xls, .csv)Supports advanced data analysis functions like VLOOKUP, XLOOKUP, and SUMIFSFree and lightweight alternative with a familiar user interfaceBuilt-in tools to easily manage merged cells and clean up data tables
QA img-9

Frequently Asked Questions

Why do formulas return zero or error when pointing to a merged cell?

When multiple cells are merged, the spreadsheet software only retains the value in the uppermost-left cell of that range. All other underlying cells are cleared and become empty. Therefore, any formula referencing rows below the first row of the merge will read a blank or zero value.

Can I use VLOOKUP directly on vertically merged cells?

Generally, no. VLOOKUP expects a solid value in every row it scans. If it searches for a match or tries to return a value from a row that falls within the 'blank' portion of a merged range, it will fail. You must use a helper column or unmerge the cells to make it work.

Is there a way to merge cells but keep data in all of them?

Standard cell merging always clears data from the secondary cells. If you want the visual appearance of horizontally merged cells without breaking the data structure, you can use 'Center Across Selection' in the Format Cells alignment options. However, this feature does not apply to vertical merging.