To compute numbers in Excel, enter a formula in a cell beginning with an equals sign, then use cell references and operators such as plus, minus, multiplication, or division. For example, if the values are in A2 and B2, type =A2+B2 in another cell and press Enter to add them. This guide covers basic calculations, built-in functions, and ways to fix common errors in Microsoft Excel for Microsoft 365 on Windows.
What You’ll Need
- Microsoft Excel for Microsoft 365 on Windows. The basic formulas in this guide also work in Excel for Mac and Excel for the web, though some ribbon locations and keyboard shortcuts differ.
- A worksheet with the numbers you want to calculate. Use separate cells for separate values when possible; formulas that refer to cells are easier to update than formulas with fixed numbers typed directly into them.
- A blank cell for the result. You can put the result beside your source data or on a separate worksheet in the same workbook.
Step-by-Step
- Enter and check your values. Put each value in its own cell, ideally in a clearly labeled column or row. For a quick example, enter 18 in A2 and 7 in B2. You can put labels such as First value and Second value in A1 and B1. Make sure the values are genuine numbers rather than text that only looks like numbers. In Excel, numeric values are generally aligned to the right by default, though alignment can be changed, so alignment alone is not a definitive check. Select a cell and look at its contents in the formula bar if you are unsure.
- Select the cell where you want the answer. Click an empty cell, such as C2. Keep the result separate from the input cells so the formula does not overwrite a number it needs to use. In this example, C2 will show the result of a calculation using A2 and B2.
- Type an arithmetic formula and press Enter. Every Excel formula starts with an equals sign. With 18 in A2 and 7 in B2, enter
=A2+B2in C2; the result is 25. To subtract those values, replace the plus sign with a minus sign:=A2-B2returns 11. To multiply them, use an asterisk:=A2*B2returns 126. To divide the first value by the second, use a forward slash:=A2/B2returns approximately 2.571428571. The cell displays the result, while the formula bar shows the calculation. - Use parentheses to control the order of operations. Excel calculates multiplication and division before addition and subtraction, following the usual order of operations. With 18 in A2 and 7 in B2, the formula
=A2+B2*2returns 32 because Excel multiplies 7 by 2 before adding 18. If you want to add the two cells first and then double the sum, use=(A2+B2)*2; the result is 50. Add parentheses whenever they make your intended calculation clearer, even if Excel would reach the same result without them. - Use a function for a calculation across several cells. Functions are built-in formulas that perform common tasks. Suppose A2 contains 12, A3 contains 8, A4 contains 15, and A5 contains 5. In B2, enter
=SUM(A2:A5)to add the range; the result is 40. The colon in A2:A5 means every cell from A2 through A5. If you want the mean of those same four values, enter=AVERAGE(A2:A5)in B3; it returns 10. These functions update when values in the referenced cells change. - Count numeric cells when that is the calculation you mean. Adding values and counting how many cells contain numbers are different tasks. If A2:A6 contains 12, a blank cell, 7, the text pending, and 3, enter
=COUNT(A2:A6)in B6; the result is 3 because COUNT counts numeric entries, not text or empty cells. If instead you need the number of nonempty cells, use=COUNTA(A2:A6)in B7; the result is 4. Choose the function based on what you are trying to measure. - Copy a formula for repeated calculations. If you have a list of paired values in columns A and B, enter a formula in C2 using the first row, then select C2 and drag the small square at the lower-right corner of the selection, called the fill handle, down the rows. For example, with the first value in A2 and the second in B2,
=A2+B2in C2 changes to use A3 and B3 when filled into C3. Double-clicking the fill handle can fill down alongside a neighboring column of data. Check the last few results to confirm the references moved as intended. - Format the displayed result and save your work. Select the result cells, then use Home > Number Format to choose a suitable display such as Number, Currency, or Percentage. Formatting changes how a value appears; it does not normally change the underlying calculation. Use the decimal increase or decrease buttons on the Home tab if you want to show more or fewer decimal places. Save the workbook with Ctrl+S on Windows; on Mac, use Command+S. The equivalent undo shortcuts are Ctrl+Z on Windows and Command+Z on Mac.
Common Mistakes
- Leaving out the equals sign: If you type A2+B2 without the initial equals sign, Excel may treat the entry as text instead of calculating it. Start a formula with =.
- Using the wrong multiplication symbol: In Excel formulas, multiplication uses an asterisk, not the letter x. Division uses a forward slash.
- Including a header in a calculation: A range that starts in a heading cell may include text or an unintended value. Check the start and end cells in the formula before relying on its result.
- Confusing a displayed value with the stored value: A cell formatted to show zero decimal places may display 3 even when the calculated value is 2.6. Increase the displayed decimal places or inspect the formula bar when precision matters.
- Using COUNT to add values: COUNT returns how many cells contain numbers; it does not total those numbers. Use SUM for a total, AVERAGE for a mean, and COUNT for the number of numeric entries.
- Dividing by a zero or blank cell: A denominator of zero produces a division error. Confirm the divisor is present and nonzero before using a result.
Tips
Use cell references rather than typing the same values directly into every formula. If an input changes, a formula linked to its cell recalculates automatically. This also makes your worksheet easier for someone else to review. Clear labels above columns help you remember what each group of values represents, and a separate results column keeps calculations distinct from the original data.
For a long list, select the cells you want to total and look at the status bar at the bottom of the Excel window. It can show quick statistics such as Sum, Average, and Count; right-click the status bar to choose which statistics appear. This is useful for a quick check, but it does not place a formula in the worksheet. Use a formula when you need a saved result that updates with the data.
When a calculation uses several operations, write it in a way that communicates the intended sequence. Parentheses can make a complex formula easier to audit. For a result that should show a fixed number of decimal places, use cell formatting rather than rounding the value unless you specifically want to change the calculation itself. For example, displaying two decimal places may hide extra digits without removing them from the stored result.
Before filling a formula down, understand whether its references should shift. Ordinary references such as A2 move to A3 when copied down. If a formula must always use one particular cell, make that reference absolute by selecting it while editing the formula and pressing F4 on Windows to cycle through reference types. On many Mac keyboards, use Command+T to cycle reference types; depending on keyboard settings, you may need Fn with the key. Check Excel’s displayed reference before filling the formula.
Troubleshooting
The cell shows the formula instead of an answer. First check that the entry starts with = and that the cell is not formatted as Text. Select the cell, choose Home > Number Format > General, then press F2 and Enter on Windows to re-enter the formula. On a Mac, use Control+U to edit the cell, then press Return. Also check whether Show Formulas is turned on: press Ctrl+` on Windows to toggle it, where ` is the grave accent key. On a Mac, the shortcut can vary by keyboard layout; use Formulas > Show Formulas if available in the ribbon.
The result is wrong or unexpected. Click the formula cell and inspect the formula bar. Confirm that each reference points to the intended input and that parentheses group the operations correctly. If you copied a formula, compare its references with the row it is meant to calculate. Check whether a value was entered as text, whether the selected range skips a row, or whether a number has more decimal places than its displayed format suggests.
The cell displays #DIV/0!. The formula is dividing by zero or by a blank cell. Find the denominator in the formula, then enter a valid nonzero value or adjust the calculation to handle missing input. Do not simply hide the error if the missing value affects the meaning of the answer.
The cell displays #### or an old result. A row of number signs usually means the column is too narrow to show the formatted value; widen the column by dragging the boundary between its column letters. If a formula result seems not to update, check Formulas > Calculation Options and select Automatic. In manual calculation mode, press F9 on Windows to recalculate; on Mac, use Fn+F9 where required by the keyboard.
Frequently Asked Questions
How do I add numbers in Excel? Put the values in cells and enter an addition formula in another cell, or use SUM for a range. For example, with values in A2 through A5, =SUM(A2:A5) totals them. Check that the range includes all the intended cells.
How can I calculate a percentage? Divide the part by the total, then format the result as a percentage. With the part in A2 and the total in B2, enter =A2/B2 in C2. If A2 is 25 and B2 is 100, the result is 0.25, which displays as 25% when C2 is formatted as Percentage. Ensure the total is not zero.
Why does Excel show a decimal when I expected a whole number? The calculation may produce a fractional result, or the cell may display more decimal places than you want. Use the number-format controls to change how many places appear. If you need to round the calculated value itself, choose an appropriate rounding method rather than only changing its display.
Can I calculate without using cell references? Yes. A formula can contain numbers directly, such as =18+7, which returns 25. For a worksheet you expect to update, cell references are usually more practical because you can change an input without rewriting the formula.
Do these formulas work in Excel for Mac and Excel for the web? Basic arithmetic, SUM, AVERAGE, COUNT, and COUNTA work in those versions too. Ribbon layouts and keyboard shortcuts can differ, especially on Mac. If a shortcut does not work on your keyboard, use the relevant ribbon command or Excel’s on-screen controls.
Related
- How to Calculate an Average in Microsoft Excel Quickly
- Change Zoom in Excel Permanently: Save Your View
- How to Change Zoom in Excel: Quick Steps and Fixes
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel OFFSET Function: How to Use It in Formulas and RangesIn Excel for Microsoft 365 on Windows, OFFSET returns a reference moved a chosen number of rows and…
- Excel Column Minus Column Formula: Examples and FixesIf your values are in A2:A100 and B2:B100, enter =A2-B2 in C2 to subtract the value in column…
- Excel Slicer Custom Sort Order: How to Set ItTo give an Excel slicer a custom order, create an Excel custom list containing the slicer items in…
- Horizontal Filter in Excel: How to Filter Across ColumnsTo filter data arranged across columns in Excel for Microsoft 365, use the FILTER function with a horizontal…
- Excel: Merge Date and Time Cells Into One Cell With FormulaTo combine a date in A2 and a time in B2 into one Excel date-and-time value, enter =A2+B2…
- Excel VLOOKUP With Two Criteria: Formula and ExamplesYes. To use VLOOKUP with two criteria, combine the criteria into one helper key, then look up that…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.