Skip to content

How to Use the SUMIFS Function in Excel

    Car dealership table with SUMIFS summing the cars sold by region

    The SUMIFS function is a mathematical function in Excel designed to sum only the elements that meet specific conditions, making it extremely useful for summarizing complex situations with large amounts of data. Let’s explore together how to use the SUMIFS function.

    From a logical standpoint, the SUMIFS function is equivalent to the sum of the elements that match one or more filters.
    To learn how to use it, keep in mind that it consists of several parts:

    • sum_range [ the field containing the values to be summed ]
    • criteria_range1 [ the field that will be filtered based on the first condition ]
    • criteria1 [ the first condition ]
    • criteria_range2 [ the field that will be filtered based on the second condition ]
    • criteria2 [ the second condition ]

    =SUMIFS(sum_range,criteria_range1,criteria1,[criteria_range2,criteria2],...)

    The first three elements of the function are required, while the others are optional.
    In fact, the function requires that a field be defined on which to perform the sum, without which the function would be meaningless, and at least one “criteria_range/criterion” pair on which to filter.
    Adding a second condition is optional, and you can include up to 127 conditions.

    There is also a function called SUMIF that I strongly advise against using, since it accepts only one starting condition and is the only one among the IFS functions that lists the range to be considered as the last parameter. I find it very confusing and, in general, it should be avoided.
    Returning to SUMIFS, for the purposes of this guide, we’ve included data from a car dealership that will help us create our reports.

    Car sales table used by the SUMIFS examples

    This is a fictional dataset created solely to test the function.
    To simplify the explanation, the dataset has been formatted as a Table to make the formulas easier to read, which is why you’ll always see “TBL” to indicate the table and the columns enclosed in square brackets.

    How to Use SUMIFS with a Condition

    SUMIFS with one condition summing the cars sold in each region

    The simplest way to use SUMIFS involves setting a single text condition and a range to sum in Excel. In this case, we want to sum the number of cars sold in individual regions over a defined period:

    =SUMIFS(TBL[CARS SOLD],TBL[REGION],F4)

    In the first case, the function filters the table for “Puglia,” finding two rows containing the values 5 and 18, respectively, and adds them to get 23.
    In the second case, the filter will be “Lazio”; it will find 21, 7, and 19, resulting in 47.
    Finally, when applying the “Piemonte” filter, only the rows containing 10, 15, and 9 will match this filter, and their sum is 34.

    Clearly, this view could be improved by retrieving the regions using UNIQUE and avoiding having to enter all the values manually. In the file, F4 does exactly this:

    =UNIQUE(TBL[REGION])

    We would then have all the regions in our database, even if we were to expand it further. At this point, we could sum all the cars sold as follows:

    =SUMIFS(TBL[CARS SOLD],TBL[REGION],F4#)

    This would give us a scalable solution with all the information at our fingertips, thanks to the hash symbol #, which refers to the whole list returned by UNIQUE.

    Note: sum_range and criteria_range must always have the same size.
    In our example, this is handled automatically by using the table format, but if you find yourself setting the ranges manually, always check that the column lengths are the same; otherwise, an error will be returned.

    How to Use SUMIFS with Dates

    SUMIFS with a date condition summing the cars sold after a given date

    Let’s now explore how SUMIFS would work if we wanted to apply two conditions, one text-based and one date-based. For example, how would we determine how many cars were sold in various regions after a certain date?
    In this case, we’d simply need to add the second condition regarding the date.

    =SUMIFS(TBL[CARS SOLD],TBL[REGION],I4,TBL[DATE],">"&J4)

    This formula clearly shows how to write an inequality criterion correctly.
    The SUMIFS function generally accepts the following as criteria:

    • Cells (as in the previous example)
    • Strings containing the condition to be met, for example ">=9" or "<8". However, this approach is not recommended, since it is not scalable and the value entered in the cell remains fixed (9 will always be 9, for example)
    • A combination of these two: an inequality operator enclosed in quotation marks and a cell that can change dynamically.

    This last option is undoubtedly the most interesting because it allows you to write the inequality dynamically.
    Keep in mind that an inequality written this way consists of three parts:

    • The first part contains the quotation marks and the inequality symbol, for example ">=".
    • The second part is always the “&” symbol, which is used to link the inequality symbol to the cell’s value.
    • The third part is the value against which the inequality must be checked, indicated by a cell reference.

    For example:

    ">"&J4

    The advantage of writing the inequality this way is clear in our example; in fact, we can filter for dates after June 1, 2023, on the first row, and after September 1, 2023, on the other two rows.
    This notation is very useful when working with time intervals, but not only then.

    EXCEL TRAINING

    Want to bring these skills to your team?

    I design Excel training paths based on your goals, the participants' level and the cases you actually face at work.

    Marco Filocamo

    Marco Filocamo · Microsoft Excel MVP

    Do you have a specific file or process to improve? Explore Excel consulting →

    How to Use SUMIFS with Values Entered in an Excel Cell

    SUMIFS using criteria entered in cells to sum the cars sold

    Let’s also look at the case where we use SUMIFS to check whether a text value is entered in a specific cell. For example, what would we do if we wanted to consider only a specific manufacturer?
    In this case as well, it would be sufficient to add a condition to filter by:

    =SUMIFS(TBL[CARS SOLD],TBL[REGION],M4,TBL[DATE],">"&N4,TBL[CAR],"*"&O4&"*")

    This last condition is a bit different from the ones we’ve written so far; in fact, it contains wildcard characters that match “any character.”
    In this case, for example, cell O4 contains the word “Ford”, so "*"&O4&"*" is equivalent to "*Ford*".
    In turn, this expression is equivalent to filtering all cells that contain the word “Ford,” since there can be “any character” both before and after it.

    The SUMIFS function is therefore a rather versatile Excel function that can come in handy in many situations.
    Although it is possible to use up to 127 conditions, it is always preferable to carefully design the functions from a logical standpoint rather than taking the brute-force approach and inserting 127 filters.

    We highly recommend using this function in conjunction with the COUNTIFS function, these two functions allow you to quickly summarize data and create all kinds of reports.

    In Excel for Microsoft 365, when you need the total for every region (or every car) at once instead of one criterion at a time, GROUPBY builds the whole summary with a single formula: =GROUPBY(TBL[REGION],TBL[CARS SOLD],SUM). It returns each region with its total, plus a grand total at the bottom, and updates on its own when the data changes. See the guide to GROUPBY in Excel.

    Conclusion

    SUMIFS sums the values that meet one or more conditions on text, dates or values entered in a cell. Combined with UNIQUE and COUNTIFS, it builds dynamic reports in a few steps.

    Leave a Reply

    Your email address will not be published. Required fields are marked *