How to use SUMIF / SUMIFS with an OR Logic in Excel

Sometimes we need to make small amendments in formulas to make them effective.

Just like that, SUMIF OR.

It’s an advanced formula which helps you to increase the flexibility of SUMIF.

Yes, you can also do SUMIFS as well. But before we use it let me tell one thing about SUMIF.

In SUMIF, you can only use one criterion and in SUMIFS, you can use more than one criteria to get a sum.

Just thing like this.

Let's say, in SUMIFS, if you specify two different criteria, it will sum only those cells which meet both of the criteria.

Because it works with AND logic, so all the criteria should meet to get a cell included.


When you combine OR logic with SUMIF/SUMIFS you can sum values using two different criteria at the same time.

...without any further ado let's learn this amazing formula.

Get Better at Excel in 2018

A bundle of E-Books you need to thrive in Excel this year.

Do We Really Need OR Logic? Any Example?

Let me show you an example where we need to add an OR logic in SUMIFS or SUMIF.

Take a look at below data table where you have a list of products with their quantity and current status about the shipment.

data table to use or logic to use in sumifs sumif

In this data, you have two types of products (Faulty and Damaged) which you need to return to our vendor.

But before that, you want to calculate the total quantity of both types of products.

If you go with the normal method, you have to apply SUMIF twice to get this total.

But if you use an OR condition in SUMIF then you can get the total of both of the products with just one formula.

OK, Let's Apply OR with SUMIFS


apply formula to get or logic in sumifs

In above formula, you have used SUMIFS but if you want to use SUMIF you can insert below formula in the cell.


By using both of above formulas you will get 540 in the result. To cross verify, just check the total manually.

verify the total of damage and faulty using sumif or

How this formula Works

As I said, SUMIFS function use AND logic to sum values. But, the formula which you have used above include an OR logic in it.

To understand this formula you have to split it in three different parts.

three parts of formula to use or logic in sumifs sumif
  1. The first thing is to understand that, you have used two different criteria in this formula by using array concept. Learn more about array from here.
  2. The second thing is when you specify two different values using an array, SUMIFS has to look for both of the values separately.
  3. The third thing is even after using an array formula, SUMIFS is not able to return the sum of both of the values in a single cell. So, that’s why you have to enclose it with SUM function.

With above concept, you are able to get a total for both types of product in a single cell. It will work same with SUMIF and SUMIFS.

And, you can also further expand your formula by specifying product name in second criteria in SUMIFS to get the total for a single product.

Download this sample file from here to learn more.

Using Dynamic Criteria Range

  1. The first is, instead of using curly brackets you need to use a named range (best way is to use a table) of your value.
  2. And after that, you need to enter this formula by using Ctrl + Shift + Enter as a proper array formula.

So, now your formula will be:


using named range in sumif or

Multiple Criteria with Different Columns

Let me take you to next level of this formula. Just look at the below data table.

sumifs sumif or with multiple column data

In this table, you have two different columns with two different kind of status.

Now, from this data table you need to sum quantity where the product is damage return status is "No".

That means, only those Damage and Faulty products which are not returned yet. And, formula for this will be.


sumifs sumif or with multiple different column criteria formula

Sample File

Get instant access to all the sample files from here.


Have you ever used this kind of formula before?

Share your views with me in the comment section, I'd love to hear from you and please don't forget to share this tip with your friends.

Content Protection by


  1. Dave 26 Nov, 18 at 11:37 pm - Reply

    Hi Puneet,

    Your tips above are highly effective, and I have a secondary challenge to apply here! Hope this post isn’t too old to be reignited 🙂

    I may simply be thinking about this before having coffee every time but I can’t seem to solve it conceptually.

    Effectively I’m looking for a way to dynamically ADD or REMOVE criteria from a SUMIFS without using multiple sums under IF conditions.


    Name | Gender | Category | Sales
    Dave | Male | A | 20
    Mike | Male | B | 30
    Tracy | Female | C | 10
    Sam | Female | D | 80

    I have many more categories in my working problem, including date ranges etc (effectively invoice data summarised).

    I’m using a SUMIFS and I’d like to dynamically pick Male, Female or BOTH.

    For both my assumption is that I should dynamically remove the criteria on Gender to include BOTH.

    My only requirement is to do this in a single formula/array without an IF condition as mentioned.



  2. Kristen 8 Oct, 18 at 6:30 pm - Reply

    Hi – What if I wanted to look at Damaged OR Faulty, and control for products, like only Product B and Product C. Can you have two OR sections?

  3. Rizwan 19 Nov, 17 at 3:11 pm - Reply

    Range_Name Critaria is Awesome and Very Helpful

    Great Work Puneet

    From Rizwan Planning Engineer

    • Puneet Gogia 20 Nov, 17 at 6:19 am - Reply

      I’m glad you linked it.

  4. Ogundepo Ezekiel Adebayo 22 Mar, 17 at 11:43 am - Reply

    Oh wonderful. I’m still mastering it inorder to know how to use it offhand.

    • Puneet Gogia 22 Mar, 17 at 1:18 pm - Reply

      That’s great. Keep it up.

  5. Shay Bar-Yehuda 22 Mar, 17 at 7:13 am - Reply

    Thanks for a great tip! Is it possible to use a dynamic criteria inside the OR Logic? i.e. use cell referance instead of {“Damage”,”Faulty”}?

    • Puneet Gogia 22 Mar, 17 at 10:32 am - Reply

      Hey Shay, thank you very much for hitting me back. Your question is super awesome.

      So, if you want to create a dynamic reference, first you need to refer to a named range (best way is to use a table reference) instead of adding your values in curly brackets.

      Secondly, you have to enter formula with CSE as a proper array formula.

      And, it works like a magic.

      Tell me if you need any further help.

      • Shay Bar-Yehuda 22 Mar, 17 at 1:49 pm - Reply

        Works Like a charm. thanks again for the quick and proffesional reply

        • Puneet Gogia 22 Mar, 17 at 3:33 pm - Reply

          Yo. ../

  6. GraH 21 Mar, 17 at 6:25 pm - Reply

    Nice that is working without CSE. Just wondering if calculation time is faster then doing 2 seperate SUMIFs/SUMIFSs and then adding up. For larger datasets that can be an issue.

    • Puneet Gogia 22 Mar, 17 at 10:16 am - Reply

      Yes, it is faster than using two different calculations. But, will effect you once you try to add more criteria.

  7. indzara 21 Mar, 17 at 5:01 pm - Reply

    Very useful tip, Puneet. Thanks for sharing.

    • Puneet Gogia 21 Mar, 17 at 6:08 pm - Reply

      I’m so glad you liked it.

Leave A Comment