FormulaCraft

How to use SUMIF with an OR condition in Excel and Google Sheets

Topic:SUMIF & SUMIFS
Excel & Google Sheets
=SUMIF($A$2:$A$5,"Apple",$B$2:$B$5)+SUMIF($A$2:$A$5,"Banana",$B$2:$B$5)

Verified example

Computed by a real spreadsheet engine on the sample data below.

ItemSales
Apple500
Banana300
Cherry450
Apple200

=SUMIF($A$2:$A$5,"Apple",$B$2:$B$5)+SUMIF($A$2:$A$5,"Banana",$B$2:$B$5)1000

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Write a SUMIF for the first criterion: =SUMIF($A$2:$A$100,"Apple",$B$2:$B$100).
  2. 2Add a second SUMIF for the next criterion: +SUMIF($A$2:$A$100,"Banana",$B$2:$B$100).
  3. 3For many criteria or dynamic lists, use SUMPRODUCT: =SUMPRODUCT(($A$2:$A$100="Apple")+($A$2:$A$100="Banana")>0,$B$2:$B$100) which is equivalent but more concise for 3+ conditions.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Can I use a list of criteria stored in a range instead of hardcoding each one?

Yes with SUMPRODUCT and COUNTIF: =SUMPRODUCT((COUNTIF(E2:E5,A2:A100)>0)*B2:B100) sums column B where the value in column A appears anywhere in the criteria list E2:E5.

More on SUMIF & SUMIFS

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: