ShareYourGroupShareYourGroupExcel Formulas

Guides

How to write a formula in Excel

A formula is an instruction to work something out. You type it into a cell, and the cell shows the answer. Change any number the formula uses, and the answer changes by itself. That is the whole point of a spreadsheet, and everything else in Excel builds on it.

Every formula starts with an equals sign

Click a cell, type =, then what you want calculated, and press Enter.

The first formula adds three numbers typed in by hand. The second adds the same numbers by naming the cells that hold them. The second way is the right way. If a mark is corrected in the sheet, the total corrects itself. A number typed inside a formula is hidden from view and easily forgotten.

Without the equals sign, Excel treats what you type as plain text and calculates nothing.

Sample sheet: Marks of eight students in three subjects. One Science mark is missing (cell D6 is empty).
ABCDE
1NameClassMathsScienceEnglish
2Asha8A788591
3Ravi8B455260
4Meena8A928879
5Kabir8B334138
6Tara8A6772
7Joy8B889084
8Neha8A546158
9Imran8B787369

The operators

SignMeaningExample
+add=C2+D2
-subtract=C2-D2
*multiply=C2*2
/divide=C2/2
^to the power of=C2^2
&join text=A2&" "&B2
= <> > < >= <=compare=C2>=33

A comparison gives TRUE or FALSE.

The order of calculation

Excel does not work from left to right. It follows the school rule: brackets first, then powers, then multiplication and division, then addition and subtraction.

The third formula divides only the English mark by 3. The fourth, with brackets, gives the average. When in doubt, add brackets. They never do harm.

Functions

A function is a ready-made calculation with a name. You give it values in brackets, separated by commas, and it returns a result.

C2:E2 is a range: every cell from C2 to E2. A colon means "to". In the last formula, one function sits inside another. Excel works out the inner one first.

When you type = and the first letters of a name, Excel offers a list. Press Tab to accept a suggestion. A small tip then shows the arguments the function expects, with the optional ones in square brackets. Every function on this site is explained on its own page. The list of functions is the place to look.

Pointing instead of typing

You do not have to type cell addresses. After the equals sign, click the cell you want, or drag over a range. Excel writes the reference for you. It is quicker and avoids typing slips.

Copying a formula down a column

You write a formula once and copy it for every row. Select the cell and drag the small square at its bottom-right corner, the fill handle, down the column. Double-clicking the fill handle fills down as far as the neighbouring column has data.

As a formula is copied, its references move with it. =C2+D2+E2 in row 2 becomes =C3+D3+E3 in row 3. This is called a relative reference, and it is why one formula can serve a thousand rows. When a reference should not move, it is fixed with dollar signs. The guide on cell references explains how.

Looking at and editing a formula

Text, numbers and dates in formulas

When the cell shows the formula, not the answer

If a cell displays =C2+D2 as text, one of three things has happened: the cell was formatted as Text before you typed, there is a space or an apostrophe before the equals sign, or Show Formulas is switched on. Set the format to General and enter the formula again.

When it shows an error

A result that starts with a hash sign, such as #DIV/0! or #NAME?, means Excel could not finish the calculation. Each one has a particular meaning and cure, set out in the guide to formula errors.

Good habits from the start

  1. Put every figure that might change, such as a tax rate or a pass mark, in its own labelled cell, and refer to that cell. Do not bury it in formulas.
  2. One formula per column, the same in every row. If row 7 needs something special, think again about the design.
  3. Check a new formula against a calculation you do by hand for one or two rows.
  4. Keep formulas short. Two simple columns are better than one formula nobody can read.

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.