Function Problems

Use Excel IF to Add Cells Based on Another Worksheet

Rana GarciaRana Garcia Nov 18, 2026 869 views

Question details

Create a formula that adds C1 and C2 only when C3 on a second worksheet contains A.

Use Excel IF to Add Cells Based on Another Worksheet
Product
Microsoft Excel
Device & OS
not provided
Scenario
The values to add are on the current worksheet, while the condition is on a second worksheet.
Observed behavior
The formula should return the sum when the second worksheet's C3 equals A and a blank or zero otherwise.
Before you start

Check that C1 and C2 contain the values to add and confirm the name of the worksheet containing the condition in C3. Choose a result cell other than C1 or C2 to avoid a circular reference.

Solution 1Recommended

Use an IF Formula with a Cross-Sheet Reference

Use this formula to add two cells when C3 on another worksheet equals A.

1
Select a result cell

On the worksheet containing C1 and C2, select an empty cell such as C4.

2
Enter the formula

Type =IF(Sheet2!C3="A",C1+C2,"") and press Enter. Replace Sheet2 with the actual name of the worksheet containing the condition.

3
Check the result

Enter A in Sheet2!C3 to see the sum of C1 and C2. Enter a different value to display a blank result.

Use an IF Formula with a Cross-Sheet Reference
Return zero instead: To show zero when the condition is not met, use =IF(Sheet2!C3="A",C1+C2,0).
Work with spreadsheet formulas

Add Cells Conditionally in WPS Spreadsheets

Use the same IF formula in WPS Spreadsheets to test a cell on another worksheet and add values only when the condition is met.

  1. 1. Open the workbook: Open WPS Spreadsheets and select the workbook containing both worksheets.
  2. 2. Choose the result cell: On the worksheet with the values in C1 and C2, select an empty cell such as C4.
  3. 3. Enter the IF formula: Type =IF(Sheet2!C3="A",C1+C2,"") and press Enter. Replace Sheet2 with the name of the worksheet containing the condition.
  4. 4. Test the condition: Select the Sheet2 tab and enter A in C3, then return to the result cell to check the sum.
Use IF formulas with references to other worksheets.Open and edit Microsoft Excel XLSX files.Return a blank or zero when the condition is not met.
microsoft office alternative - wps office

Frequently Asked Questions

How do I return zero instead of a blank?

Replace the final empty string in the formula with 0: =IF(Sheet2!C3="A",C1+C2,0).

What if the worksheet name contains spaces?

Enclose the worksheet name in single quotes, for example: =IF('Sales Data'!C3="A",C1+C2,"").

Where should I enter the formula?

Enter it in an empty cell on the worksheet containing C1 and C2, such as C4. Do not enter it in C1 or C2, because that would create a circular reference.

Does the condition distinguish between uppercase A and lowercase a?

No. The comparison Sheet2!C3="A" is not case-sensitive, so it also matches a lowercase a.