Why COUNTA counts cells that look empty
=SUMPRODUCT(--(C2:C10<>""))Excel · result on the sample sheet: 5
Describe what you need and get a working SUMPRODUCT formula for Excel and Google Sheets, tested on real data before you copy it. SUMPRODUCT multiplies matching items in two or more ranges and adds the results.
Each formula below was calculated on its own sample sheet. Open one to see the sheet, why it works, and to try it yourself.
=SUMPRODUCT(--(C2:C10<>""))Excel · result on the sample sheet: 5
=SUMPRODUCT(B2:E2,$B$8:$E$8)Excel · result on the sample sheet: 5 rows (F2:F6)
=SUMPRODUCT(--(B2:B11=C2:C11))Excel · result on the sample sheet: 6
=SUMPRODUCT(--(C2:C11>B2:B11))Excel · result on the sample sheet: 5
=SUMPRODUCT((C2:C7>B2:B7)*C2:C7)Excel · result on the sample sheet: $67,420
=SUMPRODUCT((A2:A8=G1)*C2:C8*D2:D8)Excel · result on the sample sheet: $1,117.50
=NPV(E1,B3:B7)+B2Excel · result on the sample sheet: $9,548.82
=COUNTIF(B2:B8,">="&E1)Excel · result on the sample sheet: 5
You describe the task in plain English, and it writes the formula, using SUMPRODUCT where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.
SUMPRODUCT multiplies matching items in two or more ranges and adds the results.
Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the SUMPRODUCT function page has a practice exercise.