Excel Tutorial menu

Excel Formulas

A formula is an instruction that tells Excel to calculate something. It always starts with =.

Arithmetic Operators

OperatorMeaningExampleResult
+Add=20+525
-Subtract=20-515
*Multiply=20*5100
/Divide=20/54
^Power=2^38
%Percent=20%0.2
&Join text="Ali"&" Khan"Ali Khan

Formulas with Cell References

Most formulas use cell addresses. Ayesha is making a bill:

ABCD
1ItemQtyPriceAmount
2Shirt21500
3Trousers12200

In D2, type and fill down to D3:

Example

text
=B2*C2
AD
1ItemAmount
2Shirt3000
3Trousers2200

Then the total, discount and final bill:

Example

text
D4:  =D2+D3
D5:  =D4*10%
D6:  =D4-D5
CD
4Total5200
5Discount 10%520
6To pay4680

Order of Operations

Excel does not always calculate from left to right. It follows this order:

  1. Brackets ( )
  2. Percent %
  3. Power ^
  4. Multiply * and divide / (left to right)
  5. Add + and subtract - (left to right)

Compare these two formulas:

Example

text
=10+5*2
=(10+5)*2
FormulaResultWhy
=10+5*2205*2 is done first, then 10 is added
=(10+5)*230The brackets are done first

When in doubt, add brackets. They make the formula clearer and remove mistakes.

A real example: average of three marks

Example

text
=(B2+C2+D2)/3

Without brackets, =B2+C2+D2/3 would divide only D2 by 3, giving a wrong answer.

Editing and Copying Formulas

  • Click the cell and edit in the formula bar, or press F2
  • Excel colours each reference and draws a box of the same colour around the cell it uses
  • Copy a formula down with the fill handle, or double-click the fill handle to fill to the end of the data
  • Press Ctrl + ` (the key above Tab) to show all formulas instead of results, and press it again to go back

Common Formula Errors

ErrorMeaningTypical cause
#DIV/0!Division by zeroDividing by an empty cell
#NAME?Excel does not know a nameA misspelled function, like =SUMM(A1:A3)
#VALUE!Wrong type of valueAdding text to a number
#REF!Invalid referenceA cell used in the formula was deleted
#N/AValue not availableA lookup did not find a match
####Not an errorThe column is too narrow; make it wider

For example, if B2 is empty:

Example

text
=A2/B2
ABC
2500#DIV/0!

You will learn how to handle errors like this with IFERROR in the IF chapter.

Exercise

Exercise

What is the result of =4+6/2 in Excel?

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