SUMIF with INDEX and MATCH Functions in Excel

Here’s an overview of the dataset and an example of the function to extract data by summing based on criteria.

sumif index match overview in excel


Introduction to SUMIF, INDEX, and MATCH Functions in Excel

The SUMIF Function

  • Activity:

Add the cells specified by the given conditions or criteria.

  • Formula Syntax:

=SUMIF(range, criteria, [sum_range])

  • Arguments:

range- Range of cells where the criteria lies.

criteria- Selected criteria for the range.

sum_range- Range of cells that are considered for summing up.

  • Example:

We have a list of PC brands, types of devices, and total sales of these devices across six months.

sumif introduction in excel

The total sales in the month of May for desktops only of all brands uses the following formula:

=SUMIF(C5:C14,F17,H5:H14)

F17 contains the condition Desktop.

sumif introduction in excel


The INDEX Function

  • Activity:

Returns a value of reference of the cell at the intersection of the particular row & column in a given range.

  • Formula Syntax:

=INDEX(array, row_num, [column_num])

OR 

=INDEX(reference, row_num, [column_num], [area_num])

  • Arguments:

array- Range of cells, columns or rows considered for the values to lookup.

row_num- Row position in the array.

column_position- Column position in the array.

reference- Range of arrays.

area_num- Serial number of array in the reference, if you don’t mention it’ll consider as 1.

  • Example:

We want to know the value at the intersection of the 3rd row and 4th column from the array of sales prices from the table. We’ll use this formula:

=INDEX(D5:I14,3,4)

index introduction in excel


The MATCH Function

  • Activity:

Returns the relative position of an item in an array that matches a specified value in a specified order.

  • Formula Syntax:

=MATCH(lookup_value, lookup_array, [match_type])

  • Arguments:

lookup_value- Cell value that is to be looked for in the range of cells.

lookup_array- Range of cells where lookup value has to be searched for.

match_type- It’s optional. It’ll determine if you want partial or exact match from the array for your lookup value.

  • Example:

We’ll get the position of the month June (in F16) from the month headers. In Cell F17, our formula will be:

=MATCH(F16,D4:I4,0)

match introduction in excel

If we want to know the row position of the brand Dell (F19) from the names of the brands in Column B, the formula in Cell F20 will be:

=MATCH(F19,B5:B14,0)

match introduction in excel


Part 1 – Combining INDEX and MATCH Functions

We want the total selling price of the Lenovo brand in June.

  • We listed the month and device type in cells F16 and F17, respectively.
  • In Cell F18, insert:
=INDEX(D5:I14,MATCH(F17,B5:B14,0),MATCH(F16,D4:I4,0))
  • Hit Enter.

use of index max in excel


Part 2 – Using SUMIF with INDEX and MATCH Functions in Excel

We’ve modified the dataset to allow duplicated values for brand-device combinations. We’ll find the total sales of Lenovo devices in the month of June.

sumif index match in excel

Steps:

  • In the output Cell F18, insert the following formula:
=SUMIF(B5:B14,F17,INDEX(D5:I14,0,MATCH(F16,D4:I4,0)))
  • Hit Enter.

sumif index match in excel

To find the total sales for desktops, the Sum Range will be C5:C14 and Sum Criteria will be Desktop now. Here’s the formula:

=SUMIF(C5:C14,F17,INDEX(D5:I14,0,MATCH(F16,D4:I4,0)))

sumif with index match in excel


Alternative – Using SUMIFS with INDEX and MATCH Functions in Excel

We’ll find the sales of Acer desktops in the month of May. We’re adding two different criteria from Columns B and C.

Steps:

  • Insert the following formula in the result cell F19.
=SUMIFS(INDEX(D5:I14,0,MATCH(F16,D4:I4,0)),B5:B14,F17,C5:C14,F18)
  • Hit Enter.

sumifs index match in excel


Download the Practice Workbook


<< Go Back to INDEX MATCH | Formula List | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nehad Ulfat
Nehad Ulfat

NEHAD ULFAT is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including ABACUS, AutoCAD, Rhinoceros, Maxsurf, and Hydromax. He got his B.Sc in Naval Architecture & Marine Engineering from BUET but switched gears, working as a content developer.  In this role, he creates techy content all about Excel... Read Full Bio

5 Comments
  1. SUMIFS Columns Multiple with INDEX and MATCH Functions in Excel

  2. Thank you for this.

    In your first example in “Use of SUMIF with INDEX & MATCH Functions in Excel” section; how about if I want to find out the total sales for June YTD? So summing all of the months?

  3. Find Total number of Sheets for “.040 ALUM KYNAR”
    ” “.032 ALUM KYNAR” etc. Thank You

    A B
    MATERIALS SHEETS
    0 0
    0 0
    0 0
    .040 ALUM KYNAR 9
    0 0
    0 0
    .040 ALUM KYNAR 14
    0 0
    .032 ALUM KYNAR 20
    0 0
    – –
    0 0
    0 0
    – –
    .032 ALUM KYNAR 6
    0 0
    0 0
    .040 ALUM KYNAR 5
    .050 ALUM MILL 3
    0 0
    .050 ALUM KYNAR 9

    • Reply Lutfor Rahman Shimanto
      Lutfor Rahman Shimanto Feb 7, 2024 at 5:40 PM

      Hello GARY SHERMAN

      Thanks for reaching out and sharing your problem. You want to find the total number of sheets for each material type. To do so, you can use the SUMIF function to reach your goal.

      Follow these steps:

      1. Select an empty cell.

      2. Insert the following formula: =SUMIF($A$2:$A$22,$D5, $B$2:$B$22)

      3. Hit Enter.

      4. Use the Fill Handle icon to copy the formula down.

      As a result, you will see an output like the following image.

      Hopefully, the idea will help; Good luck.

      Regards
      Lutfor Rahman Shimanto
      ExcelDemy

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo