To sum values where a column says "Yes" in Excel, use a SUMIF formula with the criteria set to "Yes". For example, if the Yes/No answers are in column C and the numbers you want to add are in column D, the formula is =SUMIF(C:C,"Yes",D:D). That single formula checks every row in the criteria range, and for each one that matches exactly "Yes", it adds the value from the corresponding cell in the sum range. The result is the total of all amounts tied to a Yes. The rest of this guide covers how to build the formula for your own data, why it sometimes returns zero, and how to handle Yes spelled in different ways.
What You'll Need
- Excel 2016 or later, Excel for Microsoft 365, Excel for Mac, or Excel on the web. SUMIF is a standard function and works in all of them.
- Data laid out in rows, with one column that contains Yes or No and a separate column that holds the numbers you want to add.
- An empty cell where you will type the formula.
- Your Yes and No cells should be plain text. If they were typed into a cell with extra spaces, or produced by a formula that returns text, that matters and is covered below.
Step-by-Step
- Identify your two ranges. Look at your data and decide which column holds the Yes/No answers (the criteria range) and which column holds the amounts (the sum range). They can be any columns, and they do not have to be next to each other. Write down their letters.
- Make sure both ranges cover the same rows. If your criteria range is C2:C100, your sum range must also start and end on rows that line up with it. Excel pairs the first cell of one range with the first cell of the other. Mismatched sizes are the most common cause of wrong totals.
- Click an empty cell somewhere below or beside your data, so the result does not overwrite anything.
- Type the formula. Start with
=SUMIF(, then enter the criteria range, a comma, the criteria in double quotes, a comma, and the sum range, then a closing bracket. A concrete example:=SUMIF(C2:C100,"Yes",D2:D100). The word Yes must be inside double quotes so Excel treats it as text, not as a cell reference or a named range. - Press Enter. The cell shows the total of every number in D whose row has "Yes" in C. If nothing matches, you will see 0, which is also the clue that something is off (see Troubleshooting).
- Check one row by hand. Pick a row you know should be included, confirm it says Yes, and confirm its amount appears in the total. A quick sanity check catches range misalignment before it spreads.
- Copy the formula down or across if needed. If you want separate totals for different labels (Yes, No, Maybe), put each label in its own cell and point the criteria at that cell instead of typing quotes. For example, with the label in F2, use
=SUMIF($C$2:$C$100,F2,$D$2:$D$100). The dollar signs lock the ranges so the formula copies cleanly. - Optionally convert to a table. Select your data and insert a table from the Insert tab. Formulas that reference table columns by name, such as
=SUMIF(Table1[Answer],"Yes",Table1[Amount]), expand automatically as you add rows. Menu labels for inserting a table can differ slightly between Excel versions and platforms, but the option sits on the Insert tab in all of them.
Common Mistakes
Forgetting the quotes. Writing =SUMIF(C:C,Yes,D:D) without quotes makes Excel look for a named range or cell called Yes and return an error. The criteria must be "Yes" in double quotes when typed literally.
Criteria and sum ranges of different sizes. Excel will not always warn you. It aligns the ranges from the top-left cell, so if one range starts a row earlier, every pairing shifts and the total is wrong without any error message. Always make both ranges cover identical rows.
Hidden spaces in the Yes cells. A cell containing "Yes " with a trailing space is not equal to "Yes". The formula silently skips those rows. Watch for this after data is pasted from another program or exported from a web form.
Numbers stored as text. If the amount column looks like numbers but is left-aligned, or was imported as text, SUMIF treats them as text and adds nothing, giving 0. Converting the column to numbers (via Text to Columns or multiplying by 1 in a helper column) fixes it.
Confusing SUMIF with COUNTIF. COUNTIF counts matching rows; SUMIF adds a value from another column. If you only want the number of Yes answers, use =COUNTIF(C:C,"Yes") instead.
Using the wrong column order. SUMIF always takes the criteria range first and the sum range last. Swapping them can produce either an error or a nonsense number.
Tips
Use wildcards when spellings vary. "Yes*" matches Yes, Yes! and Yesterday, so use it carefully. A question mark matches a single character. Wildcards work in SUMIF but not in every related function, so test the result against a manual count.
For case-insensitive matching, SUMIF already ignores capitalisation: "yes", "YES" and "Yes" all match the criteria "Yes". If you need case-sensitive summing, you would need a different approach such as SUMPRODUCT with EXACT, which is more complex and usually unnecessary for Yes/No data.
To sum multiple conditions, use SUMIFS. The argument order is different: the sum range comes first, then pairs of criteria range and criteria. For example, =SUMIFS(D:D,C:C,"Yes",B:B,"January") adds D where C is Yes and B is January.
Use whole-column references like C:C only when your data is short or when you are unsure of the last row. On very large sheets, a bounded range such as C2:C5000 calculates faster, though the difference is rarely noticeable for normal data.
Format the result cell as currency or a number with thousands separators so the total is easy to read and does not display as a long unbroken string.
Put your criteria in a cell rather than inside the formula whenever the Yes/No values might change. Then a single edit updates every dependent total.
Troubleshooting
The formula returns 0. Check three things in order. First, confirm the criteria range is the column that actually contains Yes, not the amount column. Second, check for hidden spaces by clicking a Yes cell and looking at the formula bar; the text there must be exactly Yes. Third, confirm the amounts are real numbers, not text. If the amounts are text, sum them after converting.
You get #VALUE!. This usually means the criteria range and sum range are different sizes, or the quotes around Yes are missing, so Excel is trying to read Yes as a reference. Fix the range sizes and re-type the quotes.
The total is close but not right. Look for rows where the answer is "Yes " with a space, "Y" instead of "Yes", or "yes" with different capitalisation. Case does not matter, but spelling and spaces do. A quick filter on the criteria column, or sorting it alphabetically, makes the odd entries visible.
Your data changes but the total does not. If calculation is set to manual, Excel will not recalculate. Press F9 to recalculate, or check the calculation settings in the Formulas tab and set them back to automatic.
New rows are not included. If your formula uses a fixed range like D2:D100 and you add row 101, it will be ignored. Either extend the range or convert the data to a table so the reference grows with the data.
The formula shows as text instead of calculating. The cell is probably formatted as Text. Reformat the cell to General and re-enter the formula; simply reformatting may not be enough on its own.
Frequently Asked Questions
Does SUMIF care about uppercase or lowercase?
No. SUMIF matches text without regard to case, so "Yes", "YES" and "yes" all satisfy the criteria "Yes". Only spelling and spacing have to match.
Can I sum Yes values from more than one column?
SUMIF works with one criteria range and one sum range. For more conditions, such as Yes in one column and a matching date in another, use SUMIFS, which accepts multiple criteria pairs.
Why does my formula work for some rows and not others?
The usual reason is inconsistent text. A trailing space, a stray character or a value typed as "Y" instead of "Yes" will be skipped. Cleaning the criteria column so every entry is identical fixes it.
What is the difference between SUMIF and SUMIFS?
SUMIF handles a single condition and puts the sum range last. SUMIFS handles one or more conditions and puts the sum range first, followed by each criteria range and its criteria. For a single condition, both give the same answer.
Can I use a cell value as the criteria instead of typing Yes?
Yes, and it is usually better. Reference the cell directly, like F2, without quotes. Lock the ranges with dollar signs so the formula copies correctly to other cells.
Is SUMIF available in Excel on the web and on Mac?
Yes. SUMIF is a core function and works the same way in Excel for Microsoft 365, Excel for Mac and Excel on the web. Only the surrounding menus differ, not the formula itself.