Use Excel IF to Add Cells Based on Another Worksheet
Question details
Create a formula that adds C1 and C2 only when C3 on a second worksheet contains A.

- 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.
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.
Use an IF Formula with a Cross-Sheet Reference
Use this formula to add two cells when C3 on another worksheet equals A.
On the worksheet containing C1 and C2, select an empty cell such as C4.
Type =IF(Sheet2!C3="A",C1+C2,"") and press Enter. Replace Sheet2 with the actual name of the worksheet containing the condition.
Enter A in Sheet2!C3 to see the sum of C1 and C2. Enter a different value to display a blank result.

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. Open the workbook: Open WPS Spreadsheets and select the workbook containing both worksheets.
- 2. Choose the result cell: On the worksheet with the values in C1 and C2, select an empty cell such as C4.
- 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. Test the condition: Select the Sheet2 tab and enter A in C3, then return to the result cell to check the sum.

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.




