Excel IF Formula to Copy Cell C to Cell A When B Equals D
Question details
Use an IF formula to return the value from column C in column A only when the values in columns B and D match.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet needs to compare two cells in each row and conditionally display a value from a third cell.
- Observed behavior
- Column A should display the corresponding value from column C when columns B and D match; otherwise, it should appear blank.
Identify the first row of your data and make sure the destination cell in column A is available for a formula. The example below assumes the data starts in row 2.
Use an IF Formula to Return the Matching Row's Value
Use this formula when A2 should show C2 only if B2 and D2 contain matching values.
Open the worksheet in Excel and select cell A2.
Type =IF(B2=D2,C2,"") in A2 and press Enter.
Drag the fill handle at the bottom-right corner of A2 down column A to apply the formula to additional rows.

Compare Cells and Return a Value in WPS Spreadsheets
Use the same IF formula in WPS Spreadsheets to display a value from column C when the values in columns B and D match.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Select A2: Click cell A2, or select the destination cell in the first row of your data.
- 3. Enter the formula: Type =IF(B2=D2,C2,"") and press Enter. Adjust the row numbers if your data starts on a different row.
- 4. Fill down: Drag the fill handle from A2 down column A to apply the formula to the remaining rows.

Frequently Asked Questions
What does the formula show when B2 and D2 do not match?
The formula =IF(B2=D2,C2,"") returns an empty string, so A2 appears blank while retaining the formula.
Will the formula update if C2 changes?
Yes. When B2 and D2 match, A2 displays the current value of C2. To keep a fixed result instead, copy A2 and use Paste Special > Values.
What happens if B2 and D2 are both blank?
Excel treats the two blank cells as equal, so the formula returns C2. To require B2 to be nonblank, use =IF(AND(B2<>"",B2=D2),C2,"").
How do I use the formula for a different starting row?
Change all row references to your starting row. For example, enter =IF(B3=D3,C3,"") in A3 if your data starts on row 3.




