Sum Function in Excel
This article I have explain how to used sum function, when working with excel. For example calculate student mark, product total price or total quantity. Sum formula used with many condition that described one by one below with example.
First create your excelling sheet and insert some dummy records as below.
Now, Select cell where you see populated value then go to formula bar and used below formula for sum and press enter button.
See out put
Same formula you can apply for total. For example, if you want to calculate some of multiple columns or multiple row value, then simple pass cell index range. For example if I want get total value of “Marks” and “Max” column then formula as given below
Sum a range of cells OFFSET
If you insert a row directly above the SUM function in the previous example, the new row may not be included in the SUM. It may continue to sum cells B2:B6, and ignore B7. To ensure that new rows are included in the total, you can use the OFFSET function with the SUM function.
Formula is given below
Now insert one row and see output
You have seen, when new row added into sheet, that value auto calculated into in to “Total” row.
Sum cells that match criteria – SUMIF
You can calculate a total for rows that meet a specific criterion. In this example only the rows with Laptop orders will be included in the total. Below I have given formula and prefer to write don’t copy past.
Match criterion in a string
You can add cells that contain a criterion as part of the cell's contents. For example all Laptop, Dell Laptop, and HCL Laptop etc. orders will be summed, because they contain the string "Laptop".
Criterion and operator
You can use an operator with a criterion. In this example only the rows where the number of sales reps is greater than or equal to ten will be included in the total.
Sum cells that match multiple criteria - SUMIFS
In Excel 2007 and later versions, you can use the SUMIFS function to calculate a total for rows that meet two or more criteria. In this example only the row where the Device is "Laptop" and the number of order is greater than or equal to ten will be included in the min order.
Sum of Few Top Numbers
If a few numbers are to be summed, e.g. top 3, you can type the numbers into the formula. For example:
Sum of Many Top Numbers
If many top numbers are to be summed you can include the INDIRECT function in the formula with the SUM function. In the INDIRECT function, use row numbers that represent the numbers you want to include. In this example, rows 1:10 are used, so the top 5 numbers in the referenced range will be summed.
Note: This is an array formula, and must be array-entered. To do this, hold the Ctrl and Shift keys, and press Enter
Sum Variable Top Numbers
If a variable number of top numbers are to be summed you can include the INDIRECT function in the formula with the SUM function, as shown above, and refer to a cell that holds the variable..
In cell d2, type the number of top cells, e.g. 5
This is an array formula, and must be array-entered. To do this, hold the Ctrl and Shift keys, and press Enter