Microsoft Office

How To Create A Formula In Microsoft Excel

To create a formula in Microsoft Excel, select the cell where you want the answer, type an equals sign (=), enter your calculation and press Enter. For example, =A1+B1 adds the values in A1 and B1. Use cell references so the result can update when.

Which licences fit your PC setup?

Prices are an AUD snapshot, not a live quote. Confirm variant and total on the listing.

Create your first Excel formula

Start with a simple addition so you can check both the formula and its result.

  1. Enter 10 in cell A1 and 5 in cell B1.
  2. Select C1, the cell where you want the answer.
  3. Type =A1+B1. You can also type =, click A1, type + and click B1.
  4. Press Enter. C1 should display 15.
  5. Change A1 to 20. With automatic calculation enabled, C1 updates to 25.

The result appears in the cell, while the formula appears in the formula bar when you select that cell. To change the calculation, select C1, edit the formula in the formula bar and press Enter again.

You can enter fixed numbers directly, such as =10+5. Referencing cells is usually more practical because you can change the inputs without editing the calculation.

Choose operators and control calculation order

Excel uses + for addition, - for subtraction, * for multiplication, / for division and ^ for powers. For example, =A1*B1 multiplies two values, while =A1/B1 divides the first by the second.

In ordinary arithmetic formulas, Excel calculates powers before multiplication and division, then addition and subtraction. Operations at the same priority are evaluated from left to right. Use parentheses to make the intended sequence clear.

  • =A1+B1*C1 multiplies B1 by C1, then adds A1.
  • =(A1+B1)*C1 adds A1 and B1 first, then multiplies the total by C1.

Keep units consistent. Multiplying a quantity by a price gives a total cost; adding those two inputs would produce a number with no useful meaning.

Use functions for totals, averages and conditions

A function is a built-in calculation used within a formula. Type its name after the equals sign, then put its inputs, called arguments, inside parentheses. In =SUM(A1:A5), the colon defines a range that includes A1 through A5.

  • =SUM(A1:A5) adds the numbers in the range.
  • =AVERAGE(A1:A5) calculates their arithmetic mean.
  • =MIN(A1:A5) returns the smallest number.
  • =MAX(A1:A5) returns the largest number.
  • =COUNT(A1:A5) counts cells containing numbers.
  • =IF(A1>=50,"Pass","Review") returns Pass when A1 is at least 50, and Review otherwise.

Put text results inside straight double quotation marks, as shown in the IF example. These examples use commas between arguments; some regional settings require semicolons instead.

For a guided approach, select the result cell and use Insert Function beside the formula bar. Choose a function and supply its arguments. Check the selected range before accepting it, particularly if your worksheet includes subtotals or headings.

Choose the right reference before copying a formula

Cell references determine what happens when you copy a calculation to another location. Use relative references for inputs that should follow each row, and absolute references for fixed inputs such as a rate.

Reference type Example Behaviour when copied When to use it
Relative A1 Both the column and row can change. Repeat a calculation for each row or column.
Absolute $A$1 Both the column and row stay fixed. Reuse a rate or other input stored in one cell.
Mixed $A1 or A$1 Only the part without a dollar sign can change. Copy across a grid while keeping one column or row fixed.

Fill a calculation down a column

Suppose column A contains quantities and column B contains unit prices, with headings in row 1.

  1. Enter =A2*B2 in C2 and press Enter.
  2. Select C2 and drag the fill handle, the small square at the bottom-right corner of the selection, down through the required rows.
  3. Select C3 and check that its formula is =A3*B3.

If E1 holds a fixed percentage rate, use =C2*$E$1 to calculate that percentage of each row's total. When copied down, C2 changes to C3, C4 and so on, while $E$1 stays fixed. Enter the rate as a percentage, such as 10%, if that is what the calculation requires.

Reference values on another worksheet

To use a value from another sheet in the same workbook, place the sheet name and an exclamation mark before the cell reference. For example, =Sheet2!A1+Sheet3!B1 adds values from two sheets.

Sheet names can contain spaces. Enclose those names in single quotation marks, as in ='Sales Data'!B2. You can also start a formula, select the other sheet and click the required cell to let Excel insert the reference.

Find and fix formula problems

Check the formula's inputs before changing its logic. A calculation can return a plausible number even when it references the wrong cells.

  • #DIV/0! means the formula is dividing by zero or a blank cell.
  • #VALUE! can indicate an unsuitable input, such as text where arithmetic needs a number.
  • #REF! indicates an invalid reference, often after referenced cells have been deleted.
  • #NAME? often means a function name is misspelt, a named range is undefined or text lacks quotation marks.

If the cell displays the formula itself, check for a leading apostrophe or Text formatting. Change the format to General and re-enter the formula. If formulas are visible throughout the sheet, check whether Show Formulas is enabled. If results do not refresh after input changes, check the workbook's calculation setting.

Once you understand an expected error, IFERROR can provide a readable alternative. For example, =IFERROR(A1/B1,"Check inputs") displays Check inputs if the division returns an error. Avoid hiding errors before investigating their cause.

Continue with a working spreadsheet

Browse the Microsoft Office guides for related tasks. If you are also setting up Office, the guides on activating Microsoft Office using Command Prompt and finding a Microsoft Office product key using Command Prompt cover those setup topics.

Now create a quantity-and-price calculation in your own worksheet, copy it down one row and change an input to check that both the references and result behave as intended.

Other editions for separate workloads

Other editions for separate workloads; prices in AUD, confirm the total on the listing.

How to check this worked

  1. Open Settings, System, Activation and confirm the edition shown.
  2. Enter the key and run activation; expect a green tick within a minute.
  3. Reboot and re-check activation survives the restart.

FAQ

What else should you know before buying?

What do I need before starting?
Read the requirements and confirm the edition first; the steps assume the machine is compatible.
How do I know the licence is genuine?
Activate on Microsoft's servers and check Settings, System, Activation. A working activation is the test.
Is this a subscription?
Keys sold here are one-time lifetime licences. Microsoft 365 plans are billed by Microsoft instead.
What if the key fails?
Email hi@ms.codes with the order number and a screenshot. Replacement or refund applies within 30 days.

Check who prepared and reviewed this guide

Written by
MS.Codes editorial
Reviewed by
Support team

Last verified: (source review; see test status above).

Recent Post