How to Sum Multiple Rows Using INDEX MATCH Formula

For illustration, we have a Customer-wise Sales report of a company.

index match sum multiple rows

Using this table, we will find the Total Purchase of any Customer across several months using INDEX-MATCH.


Method 1 – Using SUM Function

Steps:

  • Select cell D14 and enter the following formula.
=SUM(INDEX(number_array,,MATCH(lookup_value,lookup_array,0)))
  • At the very beginning, go to cell D14 and enter the following formula.
=SUM(INDEX(C6:G11,,MATCH(D13,C5:G5,0)))

We have inserted the range of numbers inside the INDEX function as the array. We have inserted two commas (,). The row and column numbers are entered inside the INDEX function. We have left the placeholder for the row number. This is done so that all the rows will be taken into account. The MATCH function returns the column number. Within the MATCH function, we have inserted the search key as our lookup_value and a lookup_array where we may find the search key. 0 denotes the Exact Match.

  • Press ENTER.

Using SUM Function

The total amount spent by customer Jay will be displayed.

Instead of the SUM function, you can use the SUMPRODUCT function.

  • Select cell D14 and insert the following formula.
=SUMPRODUCT(INDEX(C6:G11,,MATCH(D13,C5:G5,0)))
  • Press ENTER.

Using SUMPRODUCT Function to Sum Multiple Rows Using INDEX MATCH

The SUMPRODUCT function works better for an array.


Method 2 – Utilizing AGGREGATE Function

Steps:

  • Select cell D14 and enter the following formula.
=AGGREGATE(9,behavior_option,INDEX(number_array,,MATCH(lookup_value,lookup_array,0)))

To do this in our worksheet,

  • At first, select cell D14 and write down the following formula.
=AGGREGATE(9,0,INDEX(C6:G11,,MATCH(D13,C5:G5,0)))

To get the sum, we need to use 9 as the function_number. We have used 0 as our behavior_option. The function of the INDEX-MATCH is similar to the previous, it returns the range where we need to execute our operation.

  • Press ENTER.

Utilizing AGGREGATE Function

It will show the Total Purchase amount for customer Jay.
Let’s change the criteria (Customer name) and see if the formula works.

Utilizing AGGREGATE Function to Sum Multiple Rows Using INDEX MATCH

The formula gave us the Total Purchase amount made by Wernar from January to June.


Method 3 – Applying SUBTOTAL Function

Similar to the AGGREGATE function, SUBTOTAL also returns the SUM, AVERAGE, COUNT and MAX.

Steps:

  • Select cell D14 and enter the following formula.
=SUBTOTAL(9/109,INDEX(number_array,,MATCH(lookup_value,lookup_array,0)))
  • Firstly, go to cell D14 and paste the formula below.
=SUBTOTAL(9,INDEX(C6:G11,,MATCH(D13,C5:G5,0)))

We have chosen 9 since we want to include the hidden values (though we didn’t have any hidden ones).

  • Press ENTER.

Applying SUBTOTAL Function

  • Let’s check it for Havart.

Applying SUBTOTAL Function to Sum Multiple Rows Using INDEX MATCH


How to Sum Across Multiple Sheets with INDEX-MATCH Formula

Steps:

We have the Sales amount of 3 different products in 3 different worksheets.

Sales of Notebook

Sales of Monitor

In the following sheet, the Sales of a particular Device or component on a particular Date will be extracted from other corresponding worksheets.

How to Sum Across Multiple Sheets with INDEX-MATCH Formula

  • In the Notebook worksheet, select the entire table (B4:C10).
  • Go to the Formulas tab and select the Name Manager command on the Defined Names
  • Select the New button in the Name Manager dialog box.

Defining New Names

  • In the New Name dialog box, enter Notebook in the Name box.
  • Give the cell reference of B5:C10 in the Refers to box.
  • Click OK.

Working on New Name Dialog Box

  • Follow the previous step for all other worksheets and name the corresponding tables with the device or components present in the Summary sheet.
  • Close the Name Manager dialog box.

  • In the first output cell D5, enter the following formula:
=INDEX(INDIRECT(B5&"[Sales]"),MATCH(Summary!$C5,INDIRECT(B5&"[Date]"),0))
  • Press ENTER.

How to Sum Across Multiple Sheets with INDEX-MATCH Formula

Using Fill Handle Tool

You’ll be able to display the sales of other components or devices on the specified dates.

INDEX MATCH Across Multiple Sheets


How to Apply SUMIFS with INDEX MATCH for Multiple Columns

We have the “Monthly Sales of ABC Company” for various Products of 3 Sales Persons.

How to Apply SUMIFS with INDEX MATCH for Multiple Columns

The aim is to find the Sales of a particular Sales Person based on the Month and Product.

Steps:

  • Enter the Name of “Sales Person”, Product and Month in cells D18, D19, and D20
  • Go to cell D21 and enter the following formula.
=SUMIFS(INDEX($D$5:$H$16,,MATCH($D$20,$D$4:$H$4,0)),$B$5:$B$16,$D$18,$C$5:$C$16,$D$19)
  • Press ENTER.

SUMIFS with INDEX MATCH for multiple columns


Download Practice Workbook


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

Get FREE Advanced Excel Exercises with Solutions!
Shakil Ahmed
Shakil Ahmed

My name’s Shakil. My articles are targeted to support you in enriching knowledge regarding different features related to Microsoft Excel. I am fond of literature, hope some knowledge from them will help me providing you some engaging articles even though some weary technical terms.

2 Comments
  1. Excellent post, it help me to find a solution for my problem.
    In the last part of the post, I would be interested if there is a way to calculate the cumulative sales let’s say for Jimmy from Jan-22 to May-22.

    Thanks so much,

    Javier

    • Reply Avatar photo
      Md. Abdur Rahim Rasel Aug 21, 2023 at 1:39 PM

      Hello JAVIER!
      Thank you for sharing your problem with us. We have got a very simple solution to your problem. Let’s follow the instructions below to fix your problem.
      In cell B21, write down the following FILTER function to filter Jimmy’s data.
      =FILTER(B5:H16, B5:B16=C18, "no results")
      Filtering Data
      Hence, type the SUM function in cell I21 to calculate cumulative sales.
      =SUM($D$21:H21)
      Calculating Cumulative Sales of a Particular Sales Representative
      As a result, you will be able to calculate the cumulative sales of a particular sales representative.
      Please download the Excel file for solving your problem and practice with it.
      Cumulative Sales.xlsx
      If you are still facing issues, please mail us at the address below.
      [email protected]
      Once again, thank you for your appreciation and for being with us.
      Regards
      Md. Abdur Rahim Rasel
      Exceldemy Team

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo