Excel Tutorial menu

Excel Functions: SUM, AVERAGE, COUNT, MIN, MAX

A function is a ready-made formula. You give it some values, and it gives back a result.

How a Function is Written

Example

text
=FUNCTIONNAME(argument1, argument2, ...)
  • Start with =
  • Write the function name (not case sensitive)
  • Put the inputs, called arguments, inside brackets, separated by commas
  • Arguments can be numbers, cells, ranges or even other functions

In some regional settings Excel uses a semicolon ; instead of a comma between arguments. If a comma gives an error, try a semicolon.

The Example Data

A class result sheet for this chapter:

AB
1StudentMarks
2Ali78
3Ayesha91
4Bilal65
5Sanaabsent
6Hamza84

The Most Used Functions

Example

text
=SUM(B2:B6)
=AVERAGE(B2:B6)
=COUNT(B2:B6)
=COUNTA(B2:B6)
=MIN(B2:B6)
=MAX(B2:B6)
FunctionWhat it doesResult
SUMAdds the numbers318
AVERAGEAverage of the numbers79.5
COUNTCounts cells with numbers4
COUNTACounts cells that are not empty5
MINSmallest number65
MAXLargest number91

Notice that "absent" is text, so SUM, AVERAGE, COUNT, MIN and MAX ignore it, while COUNTA counts it.

AutoSum

The quickest way to add a column: click the cell under the numbers and press Alt + =. Excel writes the SUM formula and guesses the range. Press Enter to accept.

The arrow next to the AutoSum button (Home tab) also offers Average, Count, Max and Min.

Rounding Numbers

ROUND rounds to a number of decimal places:

Example

text
=ROUND(79.456, 1)
=ROUND(79.456, 0)
=ROUND(AVERAGE(B2:B6), 0)
FormulaResult
=ROUND(79.456, 1)79.5
=ROUND(79.456, 0)79
=ROUND(AVERAGE(B2:B6), 0)80

The last example puts one function inside another. Excel calculates the inner one first. Formatting a cell to show fewer decimals only changes how it looks; ROUND changes the actual value.

Counting and Adding with Conditions

COUNTIF counts cells that meet a condition, and SUMIF adds values that meet a condition.

Ali's shop sales:

AB
1CategoryAmount
2Grocery1200
3Bakery450
4Grocery800
5Drinks300
6Bakery650

Example

text
=COUNTIF(A2:A6, "Grocery")
=SUMIF(A2:A6, "Bakery", B2:B6)
=COUNTIF(B2:B6, ">500")
=SUMIF(B2:B6, ">=500")
FormulaResultMeaning
=COUNTIF(A2:A6, "Grocery")2Two grocery sales
=SUMIF(A2:A6, "Bakery", B2:B6)1100Total bakery sales
=COUNTIF(B2:B6, ">500")3Sales over Rs 500
=SUMIF(B2:B6, ">=500")2650Total of sales of Rs 500 or more

For more than one condition, use COUNTIFS and SUMIFS:

Example

text
=SUMIFS(B2:B6, A2:A6, "Grocery", B2:B6, ">1000")
Result
1200

Inserting a Function

If you do not remember a function's arguments:

  • Click the fx button next to the formula bar to search for a function and fill a form
  • Or start typing =SUM( and Excel shows a small tip with the arguments

Exercise

Exercise

A range has the values 10, 20, the text "N/A" and 30. What does =COUNT(range) return?

Learn Excel with a teacher

Join the CIT (Computer Information Technology) course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp