How to Write Formula in Excel

If you just need to write formula in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: type = in the cell, then build the calculation by clicking the cells you want rather than typing their addresses, and press Enter.

On this page7
ƒxFormula GeneratorLive

Fill in the cell references from your own sheet — the formulas update live.

Your formula

XLOOKUP (Excel 2021+ / Google Sheets) · Excel & Sheets

INDEX + MATCH (works in every version) · Excel & Sheets

VLOOKUP (classic) · Excel & Sheets

Only possible here because the return column is to the right of the lookup column.
Runs entirely in your browser — your data never leaves this page.
=B2*C2
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

Every formula starts with an equals sign, which is what tells Excel the rest of the entry is to be computed rather than stored. After that it is a mix of references (B2), operators (+ - * / ^ &), numbers, and functions such as SUM or IF. Clicking a cell while typing inserts its reference, which is both faster and the only way to avoid the mis-typed address that produces a plausible wrong answer. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “write formula in excel”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

Quantity 12 sits in B2 and unit price 4.75 in C2. Select D2, type =, click B2, type *, click C2 and press Enter: D2 shows 57. Extending it to =B2*C2*(1-E2) applies the discount in E2, and double-clicking the small square at the corner of D2 fills the formula down the whole column. A workbook full of typed constants looks identical to one full of formulas until the inputs change, and only one of them is still right afterwards. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. The short version of “write formula in excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Typing values into the formula (=12*4.75) instead of references, so the answer stops being connected to the data.
  • Forgetting the leading =, which leaves the text sitting in the cell as a label.
  • Entering a formula in a cell already formatted as Text, where it is stored as a string and never calculates.
  • Relying on the default order of operations for mixed arithmetic instead of making it explicit with brackets.

Frequently asked questions

Why does my formula display instead of calculating?

The cell is formatted as Text, or Show Formulas is on. Set the format to General and re-enter it, or press Ctrl+` to switch Show Formulas off.

What is the difference between a formula and a function?

A formula is the whole entry after the =. A function is a named building block, such as SUM, that a formula can use.

How do I stop a reference changing when I copy it?

Make it absolute with dollar signs, $B$2. Pressing F4 while editing cycles through the options.

Which operators does Excel use?

+ - * / for arithmetic, ^ for powers, & to join text, and = <> > < >= <= for comparison.

Other ways people ask this

This is also commonly searched as “how to write formulas in excel”, “how do i write a formula in excel”, “how do you write a formula for excel” and “how to write an excel formula”. They describe the identical operation, so you are in the right place no matter how you phrased it.

Why do people search for this in so many different ways?

Because the same task has many names. “how to write formulas in excel”, “how do i write a formula in excel”, “how do you write a formula for excel” all point at the one operation explained on this page, which is why they all lead here.