How to Use Excel IF Formula to Add Values When Cells Contain Yes
Question details
The user needs to calculate a total numerical incentive by checking multiple cells for the text "Yes" and adding a specific value for each met condition.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Calculating conditional bonuses or incentives based on text inputs across multiple columns where each column has a different assigned numerical value.
- Observed behavior
- Needs a formula that evaluates multiple distinct cells for the word "Yes", assigns a predefined number to each positive match, and returns the total sum of those numbers.
Ensure your spreadsheet data is organized with clear columns for your conditions, and decide on the specific numerical values you want to assign to each 'Yes' response.
Use Combined IF Functions with Addition
The simplest and most direct way to add values conditionally is to write a separate IF statement for each cell and add their results together using the plus (+) operator.
This method evaluates each condition independently. If the first cell meets the condition, it returns the assigned value; otherwise, it returns zero. The same logic applies to the second cell, and the results are simply summed up.
Click on the empty cell where you want the total calculated value to appear.
Type the formula =IF(C2="Yes",25,0)+IF(D2="Yes",40,0) into the formula bar. Replace C2 and D2 with your actual cell references, and 25 and 40 with your desired numerical values.
Press Enter. The cell will display 25 if only C2 is 'Yes', 40 if only D2 is 'Yes', 65 if both are 'Yes', and 0 if neither contains 'Yes'.

Use Boolean Logic Multiplication
A more compact formula uses Boolean arithmetic, which treats a TRUE condition as 1 and a FALSE condition as 0 to multiply against your target values.
Easily Manage Complex Formulas in WPS Spreadsheet
WPS Spreadsheet provides a seamless and intuitive environment for creating, editing, and managing complex logical formulas like IF, SUMIF, and boolean arrays. It is an excellent tool for handling data conditions efficiently.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook in the Spreadsheet module.
- 2. Input Your Data: Enter your 'Yes' and 'No' text conditions in the respective columns.
- 3. Apply the IF Formula: Type your combined IF formula into the target cell to automatically calculate your conditional values based on the text inputs.

Frequently Asked Questions
Can I use the SUMIF function to achieve this instead of IF?
SUMIF is typically used when evaluating a single range against a criteria to sum values from a parallel range. Because you are assigning different specific values (like 25 and 40) to distinct individual columns based on the 'Yes' text, chained IF functions or boolean arithmetic are the correct approaches.
How do I add a third condition, such as E2 equals 'Yes' for 50?
You can easily expand the formula by adding another IF statement to the chain with a plus sign (+). For example, your formula would look like this: =IF(C2="Yes",25,0)+IF(D2="Yes",40,0)+IF(E2="Yes",50,0).
Why is my formula returning 0 when the cell clearly contains 'Yes'?
This usually happens due to hidden leading or trailing spaces in your cells (e.g., 'Yes '). An exact match condition like C2="Yes" will fail if spaces exist. You can fix the data by removing spaces, or modify the formula to use the TRIM function or wildcard searches.




