Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Count unique text values with criteria
  • How to get relative row numbers in a range in Excel
  • Vlookup Examples in Excel
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • MATCH function: Description, Usage, Syntax, Examples and Explanation

Data Analysis Examples

  • How to create Gauge Chart in Excel
  • How to count table columns in Excel
  • How to create dynamic reference table name in Excel
  • Working With Tables in Excel
  • Create Scatter Chart in Excel

Data Validation Examples

  • Excel Data validation must contain specific text
  • Excel Data validation unique values only
  • Excel Data validation number multiple 100
  • Prevent invalid data entering in specific cells
  • Excel Data validation whole percentage only

Sum range with INDEX in Excel

by

This tutorial shows how to calculate Sum range with INDEX in Excel using the example below;

 Formula

=SUM(INDEX(data,0,column))

Explanation

To sum all values in a column or row, you can use the INDEX function to retrieve the values, and the SUM function to return the sum.  This technique is useful in situations where the row or column being summed is dynamic, and changes based on user input.  In the example shown, the formula in H6 is:

=SUM(INDEX(data,0,H5))

where “data” is the named range C5:E9.

Worked Example:   How to create dynamic reference table name in Excel

How this formula works

The INDEX function looks up values by position. For example, this formula retrieves the value for Acme sales in Jan:

=INDEX(data,1,1)

The INDEX function has a special and non-obvious behavior: when the row number argument is supplied as zero or null, INDEX retrieves all values in the column referenced by the column number argument. Likewise, when the column number is supplied as zero or nothing, INDEX retrieves all values in the row referenced by the row number argument:

=INDEX(data,0,1) // all of column 1
=INDEX(data,1,0) // all of row 1

In the example for formula, we supply the named range “data” for array, and we pick up the column number from H2. For row number, we deliberately supply zero. This causes INDEX to retrieve all values in column 2 of “data’. The formula is solved like this:

=SUM(INDEX(data,0,2))
=SUM({9700;2700;23700;16450;17500})
=70050

Other calculations

You can use the same approach for other calculations by replacing SUM with AVERAGE, MAX, MIN, etc. For example, to get an average of values in the third month, you can use:

=AVERAGE(INDEX(data,0,3))
Worked Example:   Sum race time splits in Excel

Post navigation

Previous Post:

Position of max value in list in Excel

Next Post:

SUMIFS multiple criteria lookup in table in Excel

Leave a Reply Cancel reply

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

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • Remove unwanted characters in Excel
  • CONCATENATE function: Description, Usage, Syntax, Examples and Explanation
  • UNICHAR function: Description, Usage, Syntax, Examples and Explanation
  • Join cells with comma in Excel
  • How to count specific characters in a range in Excel
  • Get age from birthday in Excel
  • How to get same date next year or previous year in Excel
  • DAY function: Description, Usage, Syntax, Examples and Explanation
  • Two ways to sum time over 30 minutes in Excel
  • How to calculate most recent day of week in Excel
  • Tax rate calculation with fixed base in Excel
  • Calculate interest for given period in Excel
  • TBILLYIELD function: Description, Usage, Syntax, Examples and Explanation
  • YIELDDISC function: Description, Usage, Syntax, Examples and Explanation
  • FVSCHEDULE function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2022 xlsoffice . All Right Reserved. | Teal Smiles