How to Use Mixed Absolute and Relative References in Excel Formulas
Question details
The user wants to average a value from the top row and a value from the left column across an entire grid by copying a single formula using mixed cell references.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating a 2D calculation grid where a single formula is dragged across rows and down columns referencing header rows and columns.
- Observed behavior
- The user needs a formula structure that properly locks the row for the top reference and the column for the left reference while handling blank cells correctly.
Before applying the formula, ensure your data table is properly set up with numerical values in your designated top row (e.g., Row 2) and left-most column (e.g., Column B).
Using Mixed References with IF and OR Functions
Apply a mixed reference formula with IF and OR to calculate averages while outputting zero if either reference cell is empty.
Mixed references allow you to lock either the row or the column of a cell reference by placing a dollar sign ($) in front of the part you want to freeze. In a 2-way table, this lets you drag one single formula across the whole grid.
Click on the first empty cell in your grid (e.g., C3) where you want the calculated result to appear.
Type the formula: =IF(OR($B3="",C$2=""),0,(C$2+$B3)/2) into the formula bar. The $B3 reference locks Column B, while C$2 locks Row 2.
Press Enter. Then, click the fill handle at the bottom-right corner of cell C3 and drag it right across the columns, then drag it down across the rows to fill the entire grid.

Using Mixed References with Nested IF Functions
An alternative approach using nested IF statements instead of the OR function to evaluate blank cells.
Easily Calculate Complex Formulas in WPS Spreadsheet
WPS Spreadsheet provides an intuitive interface for writing and managing mixed, absolute, and relative references. It fully supports standard Excel formulas, making your data analysis seamless.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the data grid.
- 2. Enter the mixed reference formula: Click on your target cell and type your formula. You can highlight cell references and press F4 to toggle between absolute, relative, and mixed states quickly.
- 3. Drag to fill: Use the smart fill handle to copy the formula across your data grid automatically, preserving the locked rows and columns.

Frequently Asked Questions
How do I quickly switch between absolute, relative, and mixed references?
You can quickly toggle between reference types by highlighting the cell reference in the formula bar and pressing the F4 key on your keyboard. It will cycle through options like A1 (relative), $A$1 (absolute), A$1 (mixed, locked row), and $A1 (mixed, locked column).
Why does my mixed reference formula return a #DIV/0! error?
This error occurs if your formula attempts to divide by zero. Ensure that your denominator is correct and use an IF or IFERROR function to handle empty cells or zero values gracefully, preventing the calculation error.
Can I use mixed references in conditional formatting?
Yes, mixed references are incredibly useful in conditional formatting. They allow you to apply a single rule across an entire row or column based on the value in a specific locked cell, such as highlighting an entire row if a status column meets a certain condition.




