Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How To Remove Duplicates In Excel Column Or Row?
  • How to Create Gantt Chart in Excel
  • Reverse List in Excel
  • Conditional Formatting New Rule with Formulas in Excel
  • Add Outline to Data in Excel

References

  • Last row number in range
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel COLUMN Function
  • How to reference named range different sheet in Excel
  • How to get first column number in range in Excel

Data Validations

  • Excel Data validation whole percentage only
  • Excel Data validation must not contain
  • Excel Data validation require unique number
  • Excel Data validation exists in list
  • Excel Data validation allow weekday only

Sum last n columns in Excel

by

This tutorial shows how to Sum last n columns in Excel using the example below;

Formula

=SUM(INDEX(data,0,COLUMNS(data)-(n-1)):INDEX(data,0,COLUMNS(data)))

Explanation

To sum the last n columns in a table of data (i.e. last 3 columns, last 4 columns, etc.) you can use a formula based on the INDEX function. In the example shown, the formula in K5:

=SUM(INDEX(data,0,COLUMNS(data)-(K4-1)):
INDEX(data,0,COLUMNS(data)))

where “data” is the named range C5:H8

How this formula works

The key to understanding this formula is to realize that the INDEX function can be used to return a reference to entire rows and entire columns.

To generate a reference to the “last n columns” in a table, we build a reference in two parts, joined by the range operator. To get a reference to the left column, we use:

INDEX(data,0,COLUMNS(data)-(K4-1))

Since data contains 6 columns, and K4 contains 3, this simplifies to:

INDEX(data,0,4) // all of column 4

To get a reference to the right column in the range, we use:

INDEX(data,0,COLUMNS(data))

Which returns a reference to column 6 of the named range “data”, since the COLUMN function returns 6:

INDEX(data,0,6) // all of column 6

Together, the two INDEX functions return a reference to columns 4 through 6 in the data (i.e. F5:H8), which resolve to an array of values inside the SUM function:

SUM({15,14,10;9,12,12;7,9,9;12,13,13})

The SUM function then calculates and returns the sum, 135.

Post navigation

Previous Post:

How to use Excel CHOOSE Function

Next Post:

Customize Ribbon 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

Logical Functions

  • Return blank if in Excel
  • How to return blank in place of #DIV/0! error in Excel
  • IF with boolean logic in Excel
  • How to use IFS function in Excel
  • How to use Excel NOT Function

Date Time

  • How to calculate future date say 6 months ahead in Excel
  • Check If Two Dates are same month in Excel
  • WORKDAY function: Description, Usage, Syntax, Examples and Explanation
  • Convert date to Julian format in Excel
  • Convert text timestamp into time in Excel

Grouping

  • Running count group by n size in Excel
  • Calculate conditional mode with criteria in Excel
  • Group times into 3 hour buckets in Excel
  • Group numbers with VLOOKUP in Excel
  • If cell contains one of many things in Excel

General

  • Subtotal by color in Excel
  • Customize Ribbon In Excel
  • Split Cell Content Using Text to Columns in Excel
  • Mark Workbook as Final in Excel
  • Select, Insert, Rename, Move, Delete Worksheets in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning