edubun
English
1 / 19

3 / 6 · Intro

Writing your first formulas

=5+2*3 gives 11, not 21. Microsoft's operator table says multiplication comes before addition.

Jump to the 11 practice questions

You will learn

  • Start a formula with = and use the operators
  • Work out the order of operations
  • Point at cells instead of typing numbers

Before this: Numbers, text and dates

1Explain

The equals sign

A formula is an instruction that the spreadsheet carries out and replaces with its answer. In this course, start every formula with =. This makes it clear that the cell should calculate rather than store ordinary text. Type =3+4 and the cell shows 7; type 3+4 without the sign and the cell holds the text 3+4. Microsoft's help puts it this way: the equal sign tells Excel that the characters that follow make up a formula. After the sign come operands, the numbers and cell references, joined by operators such as + and *.

OperatorMeaningExample
+add=3+3 gives 6
-subtract, or negate=3-1 gives 2
*multiply=3*3 gives 9
/divide=3/3 gives 1
^power=2^3 gives 8
%percent=20% gives 0.2
&join text="North"&"wind" gives Northwind
= < > <= >= <>compare=3>2 gives TRUE

2Problem

3+4 without =

You type 3+4 into a cell, with no equals sign. What is stored?

Hint

No equals sign, no calculation.

Solution

Answer: The text 3+4

Only entries that start with = are formulas.

3Problem

2^3

What does =2^3 return?

Hint

2 × 2 × 2.

Solution

Answer: 8

^ is the power operator: 2 × 2 × 2 = 8.

4Problem

10/4

What does =10/4 return?

Hint

Division can give a decimal.

Solution

Answer: 2.5

Division gives the full decimal answer: 2.5.

5Problem

Joining with &

What does ="North"&"wind" return?

Hint

The two words stick together.

Solution

Answer: Northwind

& joins two pieces of text into one.

6Explore

Which part is worked out first

When a formula mixes operators, Excel follows a fixed order. Microsoft lists it from first to last: negation (as in −1), percent, exponent, multiplication and division, addition and subtraction, joining text with &, and finally comparisons. Operators on the same level go from left to right. So =5+2*3 multiplies first and gives 11, while =(5+2)*3 adds first because of the brackets and gives 21. Brackets are the tool for getting the order you mean, and extra brackets never hurt.

JavaScript multiplies before it adds, like Excel. It writes the power as ** and makes you put brackets around a minus sign next to it.

Expression
console.log(5 + 2 * 3);
Output
11

7Problem

=5+2*3

What does =5+2*3 return?

Hint

Multiplication first.

Solution

Answer: 11

Multiplication first: 2 × 3 = 6, then 5 + 6 = 11.

8Problem

=(5+2)*3

What does =(5+2)*3 return?

Hint

Brackets first.

Solution

Answer: 21

The brackets go first: 7 × 3 = 21.

9Explain

Minus two squared

One result surprises people who know school algebra. Because negation comes before the exponent in Excel's list, =-2^2 means (−2) squared and gives 4, not −4. If you want minus two squared, write =-(2^2). It is a good example of why a formula that matters should be checked with a value you can work out in your head.

10Problem

=-2^2 in Excel

In Excel, what does =-2^2 return?

Hint

Negation comes before the exponent.

Solution

Answer: 4

Negation comes before the exponent in Excel's order, so it is (−2)² = 4.

11Explain

Point at cells instead of typing numbers

A formula such as =3.5*4 works, but it hides the numbers inside the formula. Put the price in B2 and the quantity in C2, and write =B2*C2 in D2 instead. Now the inputs are visible, and when you change the quantity in C2 the cost in D2 updates by itself. This is the main reason spreadsheets exist. You do not have to type the address: while you are writing a formula, click a cell and its address is inserted at the cursor, and dragging across cells inserts a range.

12Problem

=B2*C2+1

B2 holds 4 and C2 holds 5. What does =B2*C2+1 return?

Hint

4 × 5, then + 1.

Solution

Answer: 21

4 × 5 = 20, then + 1 = 21.

13Problem

=B2*(C2+1)

B2 holds 4 and C2 holds 5. What does =B2*(C2+1) return?

Hint

4 × 6.

Solution

Answer: 24

Brackets first: 5 + 1 = 6, then 4 × 6 = 24.

14Problem

Why point at cells

Why write =B2*C2 instead of =3.5*4?

Hint

Change an input and watch.

Solution

Answer: It updates when B2 or C2 changes

References keep the inputs visible and the answer up to date.

15Explain

Quotes, case and editing

Function and cell names are not case-sensitive, so =b2*c2 works and is shown in capitals. Text inside a formula must be in double quotes, as in ="Total: "&D4. Without the quotes, the program looks for a name called Total, finds none, and shows #NAME?. In the lab, the panel under the grid lists every cell a formula uses, in the same colour as its outline in the grid. This makes it easy to see whether a formula points where you think it does.

16Problem

#NAME? from IF

A cell holds =IF(A1>5,Yes,"No") and shows #NAME?. What is the likely cause?

Hint

Text in a formula needs double quotes.

Solution

Answer: Yes has no quote marks

Text in a formula needs double quotes; Yes alone is read as an unknown name.

17Explore

Practice in the grid

Editing works the same way in both programs. Select the cell and click into the formula bar, or double-click the cell, change the formula and press Enter to keep it or Escape to throw the change away. Typing straight into a selected cell replaces what was there, which is a common way to lose a formula by accident. If a result looks wrong, check it with numbers you can do in your head. Put 10 and 2 in the input cells, predict the answer, and see whether the formula agrees before you trust it with real figures.

Loading

Drag to turn. Scroll or pinch to zoom.

Start a formula with =, then click B2, type *, click C2 and press Enter. Change the quantity in C2 afterwards and watch D2 and D4 follow.

18Practice

A cost column and a total

Like =B2*C2 filled down: print price times quantity for each row, then the total of all rows.

Expected output
14
12
6
32
Your code
const price = [3.5, 1.2, 2];
const qty = [4, 10, 3];
let total = 0;
for (let i = 0; i < price.length; i++) {
}
console.log(total);
Hint

Each row uses its own price[i] and qty[i], like a relative reference.

A solution
const price = [3.5, 1.2, 2];
const qty = [4, 10, 3];
let total = 0;
for (let i = 0; i < price.length; i++) {
  const cost = price[i] * qty[i];
  console.log(cost);
  total += cost;
}
console.log(total);

19

Summary

  • A formula starts with =.
  • Order: negation, %, ^, * and /, + and −, &, comparisons. Use brackets to change it.
  • Use cell references so results update when inputs change.
  • Text inside a formula goes in double quotes.

Next unitAdding up with SUM
Full text · The whole lesson as one text

The equals sign

A formula is an instruction that the spreadsheet carries out and replaces with its answer. In this course, start every formula with =. This makes it clear that the cell should calculate rather than store ordinary text. Type =3+4 and the cell shows 7; type 3+4 without the sign and the cell holds the text 3+4. Microsoft's help puts it this way: the equal sign tells Excel that the characters that follow make up a formula. After the sign come operands, the numbers and cell references, joined by operators such as + and *.

OperatorMeaningExample
+add=3+3 gives 6
-subtract, or negate=3-1 gives 2
*multiply=3*3 gives 9
/divide=3/3 gives 1
^power=2^3 gives 8
%percent=20% gives 0.2
&join text="North"&"wind" gives Northwind
= < > <= >= <>compare=3>2 gives TRUE

Which part is worked out first

When a formula mixes operators, Excel follows a fixed order. Microsoft lists it from first to last: negation (as in −1), percent, exponent, multiplication and division, addition and subtraction, joining text with &, and finally comparisons. Operators on the same level go from left to right. So =5+2*3 multiplies first and gives 11, while =(5+2)*3 adds first because of the brackets and gives 21. Brackets are the tool for getting the order you mean, and extra brackets never hurt.

One result surprises people who know school algebra. Because negation comes before the exponent in Excel's list, =-2^2 means (−2) squared and gives 4, not −4. If you want minus two squared, write =-(2^2). It is a good example of why a formula that matters should be checked with a value you can work out in your head.

Point at cells instead of typing numbers

A formula such as =3.5*4 works, but it hides the numbers inside the formula. Put the price in B2 and the quantity in C2, and write =B2*C2 in D2 instead. Now the inputs are visible, and when you change the quantity in C2 the cost in D2 updates by itself. This is the main reason spreadsheets exist. You do not have to type the address: while you are writing a formula, click a cell and its address is inserted at the cursor, and dragging across cells inserts a range.

Function and cell names are not case-sensitive, so =b2*c2 works and is shown in capitals. Text inside a formula must be in double quotes, as in ="Total: "&D4. Without the quotes, the program looks for a name called Total, finds none, and shows #NAME?. In the lab, the panel under the grid lists every cell a formula uses, in the same colour as its outline in the grid. This makes it easy to see whether a formula points where you think it does.

Editing works the same way in both programs. Select the cell and click into the formula bar, or double-click the cell, change the formula and press Enter to keep it or Escape to throw the change away. Typing straight into a selected cell replaces what was there, which is a common way to lose a formula by accident. If a result looks wrong, check it with numbers you can do in your head. Put 10 and 2 in the input cells, predict the answer, and see whether the formula agrees before you trust it with real figures.

Start a formula with =, then click B2, type *, click C2 and press Enter. Change the quantity in C2 afterwards and watch D2 and D4 follow.

When reviewing a calculation made by someone else, find the inputs before judging the result. Read the row labels and ask what each referenced cell represents. A multiplication may be arithmetically correct but still use the wrong quantity or price. Check the intended relationship in words, then compare it with the references. This catches a different kind of mistake from operator order: the spreadsheet can calculate exactly what was written while answering the wrong question.

Key points
  • A formula starts with =.
  • Order: negation, %, ^, * and /, + and −, &, comparisons. Use brackets to change it.
  • Use cell references so results update when inputs change.
  • Text inside a formula goes in double quotes.

Practice questions from Writing your first formulas on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (15)
  • Microsoft Support, "Excel specifications and limits" (support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3: 1,048,576 rows by 16,384 columns, 15-digit precision, 255 arguments)
  • "Calculation operators and precedence in Excel" (.../calculation-operators-and-precedence-in-excel-48be406d-4975-4d31-b2b8-7af9e0e2878a: operators, order negation % ^ * / + - & comparisons, =5+2*3 is 11, ="1"+"2" is 3, ="A"&TRUE is ATRUE, #### for too little space)
  • "SUM function" (.../sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89: up to 255 numbers, =A1+B1+C1 gives #VALUE! with text while SUM ignores text)
  • "Switch between relative, absolute, and mixed references" (.../dfec08cd-ae65-4f56-839e-5f0d8d0baca9: =B4*C4 copied from D4 to D5 becomes =B5*C5)
  • "Date systems in Excel" (.../e7fe7167-48a9-4b96-bb53-5612a800b487: July 5, 2011 is 40729 in the 1900 system and 39267 in the 1904 system, 1,462 days apart)
  • "Remove or allow a circular reference" (.../8540bd0f-6e97-4483-bcf7-1b49cd50d123: warning, then 0 or the last value)
  • VLOOKUP and IF pages (#N/A, #NAME? from missing quotes)
  • Google Docs Editors Help: SUM (support.google.com/docs/answer/3093669: any number of arguments)
  • DATE (answer/3092969: days counted from December 30, 1899)
  • Keyboard shortcuts for Google Sheets (answer/181110: Ctrl+D fill down, Ctrl+R fill right, Ctrl+~ show all formulas, F4 absolute/relative)
  • Files you can store in Google Drive (support.google.com/drive/answer/37603: up to 20 million cells per spreadsheet)
  • ERROR.TYPE (answer/3238305: the error values)
  • History: Smithsonian National Museum of American History, VisiCalc software and documentation, object nmah_1696121 (Bricklin and Frankston, Apple II, 1979)
  • ACM Interactions, "The first killer app: a history of spreadsheets" (2013: Lotus 1-2-3, Excel for the Macintosh in 1985)
  • Wikipedia, VisiCalc and Lotus 1-2-3 (VisiCalc used A1 notation; Lotus 1-2-3 launched 1983).

Checked: 2026-10-17