To write a formula in Excel, start with an equals sign, then enter numbers, cell references, operators, or functions.

A few small examples will show how the pieces fit together and how to avoid common mistakes.

Start every formula with an equals sign

Select a cell where you want the result, type =, and then enter the calculation.

Press Enter to finish.

For example, type =2+3 in a blank cell; the result is 5.

The equals sign tells Excel to calculate what follows instead of displaying it as ordinary text.

If you leave it out, Excel may treat the entry as text.

A formula can use fixed values, references to other cells, built-in functions, or a combination of these.

Use cell references to calculate worksheet data

Cell references make a formula respond to changes in your worksheet.

If cell A2 contains 12 and B2 contains 8, enter =A2+B2 in C2.

Excel displays 20.

If either input changes, the result updates automatically.

Excel references use a column letter and row number, such as A2.

To refer to a range of cells, put a colon between the first and last references: A2:A6 includes every cell from A2 through A6.

You can type references directly or click cells while building a formula.

For instance, type =, select A2, type +, select B2, and press Enter.

Excel inserts the references for you.

Combine references with arithmetic operators

Excel supports the familiar arithmetic operators:

  • + adds, as in =A2+B2.
  • - subtracts, as in =A2-B2.
  • * multiplies, as in =A2*B2.
  • / divides, as in =A2/B2.
  • ^ raises a value to a power, as in =A2^2.

Use parentheses when you want to control the order of operations.

For example, =(A2+B2)*C2 adds A2 and B2 before multiplying by C2.

Without parentheses, Excel follows its standard order of operations, so multiplication and division are performed before addition and subtraction.

Write a formula with a function

A function is a named calculation with a defined structure.

It usually has a function name followed by parentheses containing arguments.

For example, =SUM(A2:A6) adds the numeric values in that range.

If A2:A6 contains 4, 7, 3, 6, and 10, the result is 30.

Other useful starter functions include:

  • =AVERAGE(B2:B6) calculates the average of the numbers in the range.
  • =MIN(B2:B6) returns the smallest number.
  • =MAX(B2:B6) returns the largest number.
  • =COUNT(B2:B6) counts cells containing numbers.

Function argument separators depend on your regional settings.

Many installations use commas, as in =SUM(A2,A3); others use semicolons, as in =SUM(A2;A3).

If Excel rejects an otherwise valid formula, check the separator used by your installation.

Copy formulas with relative and absolute references

When you copy a formula to another cell, Excel normally adjusts its references.

If C2 contains =A2+B2 and you copy it to C3, Excel changes the formula to =A3+B3.

These are relative references, which are useful for applying the same calculation to each row.

To keep a reference fixed while copying, add dollar signs.

For example, =A2*$D$1 always refers to D1, while the A2 reference changes by row.

This is helpful when D1 holds a tax rate, discount, or conversion factor you want to apply to many records.

Press F4 while editing a reference to cycle through reference styles in desktop Excel; laptop keyboards may require the Fn key.

Compare values and use a conditional formula

Comparison operators let a formula test whether values meet a condition.

Enter them as formula text, for example =A2>=B2, which returns TRUE if A2 is greater than or equal to B2.

Common operators include = for equal to, <> for not equal to, > for greater than, and <= for less than or equal to.

The IF function returns one result when a condition is true and another when it is false.

If B2 contains a score, use =IF(B2>=70,"Pass","Review").

A score of 75 returns Pass; a score of 65 returns Review.

Text results need quotation marks, while cell references and numbers do not.

Check and fix common formula errors

If Excel displays an error instead of the expected result, inspect the formula and its inputs.

These checks resolve many beginner issues:

  • #DIV/0! means the formula divides by zero or a blank cell.

    Check the divisor or handle the case with an IF formula.
  • #NAME? often means a function name is misspelled or text is missing quotation marks.
  • #VALUE! can appear when a calculation receives an unexpected type of value, such as text where a number is needed.
  • #REF! indicates an invalid cell reference, often because a referenced row, column, or sheet was deleted.
  • A formula showing as text may mean the cell is formatted as Text or the entry starts with an apostrophe.

    Change the format to General, then re-enter the formula.

Check that parentheses are balanced and that range endpoints are correct.

You can select a formula cell and inspect the formula bar to see the exact expression Excel stored.

If a cell shows the formula instead of its result, also check whether Show Formulas is enabled; in many desktop versions, Ctrl+` toggles that view.

Excel and Google Sheets compatibility

Basic arithmetic, cell references, and widely used functions such as SUM and AVERAGE work similarly in current Microsoft Excel and Google Sheets.

However, newer functions can differ by product, version, or subscription.

For example, dynamic-array functions such as FILTER are available in Microsoft 365 and recent Excel releases, but may not work in older perpetual versions.

Google Sheets supports its own function set and may introduce functions on a different schedule.

When sharing a workbook or spreadsheet, confirm that everyone’s application supports the functions used.

For formulas that need broad compatibility, favor basic operators and established functions, and verify region-specific separators when moving files between locales.