How to Create Formulas in Excel: Step-by-Step Guide
In this article
Formulas in Excel perform calculations using values, cell references, operators, and functions. They enable dynamic, automatic updates when source data changes. To create a formula, start by typing an equals sign (=) in a cell, followed by the calculation or function—no extra tools or add-ins are required.
What You'll Need
- Microsoft Excel installed (Excel for Microsoft 365, Excel 2021, Excel 2019, or later—free online version at excel.office.com also works)
- A workbook with data entered in cells (e.g., sales figures, inventory counts, dates)
- Basic understanding of cell references (e.g., A1, B2:C10)
Step-by-Step
- Open your Excel workbook and click the cell where you want the formula result to appear. This cell will display the calculated value, not the formula itself.
- Type an equals sign (=) directly into the cell or the formula bar (the input box above the grid, labeled with a fx icon). Excel automatically enters formula edit mode when it sees =.
- Enter your calculation using numbers, cell references, operators, and/or functions. For example:
- Simple arithmetic: =A2+B2*C2 (multiplication happens before addition by default)
- Using a function: =SUM(A2:A10) adds all values from A2 through A10
- Mixing references and constants: =B5*0.08 for an 8% tax calculation
- Press Enter or click the checkmark (✓) in the formula bar to confirm. Excel recalculates and shows the result in the cell. The formula bar will continue to display the full formula for future editing.
- To verify the cell contains a formula, select it and check the formula bar. You should see the actual formula (e.g., =A1+B1), not just the result. The cell itself shows only the computed value.
- For multi-step formulas, use parentheses to control order of operations. For instance, =(A2+B2)*C2 forces addition before multiplication, overriding Excel’s default precedence.
- To copy a formula to other cells, click the cell with the formula, then drag the fill handle (small square in the bottom-right corner of the selection) across or down. Excel automatically adjusts cell references relative to the new location (e.g., =A2 becomes =A3 when dragged down one row).
Common Mistakes
- Forgetting the equals sign (=) at the start. Typing
SUM(A1:A10)without = treats it as text, not a formula. - Mismatched parentheses. Every opening ( must have a closing ). Excel highlights mismatched pairs in red and won’t accept the formula.
- Using commas instead of periods for decimals in some locales (e.g., 3,14 instead of 3.14). This can cause #NAME? or #VALUE! errors depending on regional settings.
- Referencing non-numeric data in arithmetic formulas. =A1+B1 returns #VALUE! if either cell contains text like "N/A".
- Accidentally including extra spaces in function names (e.g., = SUM (A1:A10)). Remove spaces: =SUM(A1:A10).
- Overlooking absolute vs. relative references. If dragging a formula and needing a cell like $A$1 to stay fixed, use dollar signs (e.g., =B2*$A$1). Without $, the reference shifts and may calculate incorrectly.
Tips
- Use the Function Library (Formulas tab > Function Library group) to browse and insert functions. Hover over a function for a brief description and syntax preview.
- Press F3 after typing = to paste a named range or defined name into your formula—useful for large, complex models.
- Hold Ctrl and click multiple non-contiguous cells or ranges while typing a formula to select them directly in the worksheet (e.g., =SUM(A1,A3,C2:C5)).
- Use the Evaluate Formula tool (Formulas tab > Formula Auditing > Evaluate Formula) to step through multi-part formulas one calculation at a time.
- Press Ctrl+` (grave accent) to toggle between showing formulas and showing results. This is invaluable for quickly auditing a sheet.
- Start with simple SUM, AVERAGE, or COUNT functions before moving to complex ones like INDEX/MATCH or XLOOKUP to build confidence.
Troubleshooting
If your formula doesn’t work as expected, follow these checks:
- Check for error codes in the cell: #DIV/0! (division by zero), #N/A (no value available), #NAME? (unknown text in formula), #NUM! (invalid numeric value), #REF! (invalid cell reference), #VALUE! (wrong data type), or ##### (column too narrow). Each error hints at the issue.
- Verify cell references are correct. If dragging a formula and references shift unexpectedly, press F4 after selecting a cell in the formula bar to toggle between absolute ($A$1), mixed ($A1, A$1), and relative (A1) references.
- Ensure source cells contain valid data. If A1 contains text, =A1*100 returns #VALUE!. Convert text to numbers with the Error Checking button (green triangle in corner) or using =VALUE(A1) as a helper.
- Re-enter the formula manually. Sometimes invisible characters or extra spaces cause silent errors. Delete the formula, re-type =, then rebuild it step by step.
- Check for circular references. If Excel displays a warning about a circular reference, your formula refers (directly or indirectly) to its own cell. Use Formulas tab > Formula Auditing > Error Checking > Circular References to locate and fix it.
- Confirm your workbook is set to automatic calculation. Go to Formulas tab > Calculation Options and make sure Automatic is selected. If Manual is chosen, press F9 to force recalculation.
Frequently Asked Questions
Can I create a formula that works across multiple sheets?
Yes. Reference another sheet by prefixing the sheet name and an exclamation mark, like =SUM(Sheet2!A1:A10). If the sheet name has spaces, wrap it in single quotes: =SUM('Q1 Data'!A1:A10).
How do I prevent Excel from changing cell references when I copy a formula?
Use absolute references with dollar signs. For example, =$A$1 locks both column and row. If you only want to lock the column, use =A$1 (locks row 1 but allows column to shift).
Why does my SUM formula show 0 even though cells have numbers?
This often happens when numbers are stored as text. Check for green triangles in the top-left of cells (indicating error potential). Convert text to numbers by selecting the range, clicking the warning icon, and choosing "Convert to Number", or use =SUMPRODUCT(--range) as a workaround.
Can I use Excel formulas in the free online version?
Yes, most standard formulas (SUM, AVERAGE, IF, VLOOKUP, XLOOKUP, TEXT, etc.) work in Excel on the web. Some advanced functions like array formulas with Ctrl+Shift+Enter or newer dynamic array functions (e.g., SORT, UNIQUE) may be limited depending on your Microsoft 365 subscription tier.
What’s the difference between a formula and a function?
A formula is any expression that starts with = and performs a calculation (e.g., =A1+B1*C1). A function is a pre-defined formula that takes arguments and returns a result (e.g., =SUM(A1:A10)). All functions are formulas, but not all formulas are functions.
How do I find all formulas in a large worksheet?
Press Ctrl+` to toggle formula view, which shows every formula in its cell. Alternatively, use Find (Ctrl+F), type = in the Find what box, and click Find All to list all formula locations.