Excel Formulas by Example: Learn by Doing
In this article
Microsoft Excel for Windows formulas are best understood through practical examples that show how to combine functions to solve real tasks. This article explains core formula concepts with concrete, copy-paste-ready examples, so you can learn by doing rather than memorizing syntax.
Why Examples Beat Memorizing Functions
Excel has over 450 functions, but most users only need a handful. When you learn by example, you see how functions fit together—like nesting IF inside SUMIF to sum only values that meet a condition. Examples also reveal the logic behind cell references, relative vs. absolute, and error handling, which are the real foundation of formula fluency.
Anatomy of an Excel Formula
Every formula in Excel starts with an equals sign (=). After that, you can use numbers, cell references, operators, and functions. For example, =A1+B1 adds the values in cells A1 and B1. A function like =SUM(A1:A10) adds a range. Key parts to understand:
- Operators:
+,-,*,/,^(exponentiation), and&(text concatenation). - Cell references: Relative (A1), absolute ($A$1), mixed ($A1 or A$1). Press F4 to toggle.
- Functions: Predefined formulas like
SUM,AVERAGE,IF,VLOOKUP. - Arguments: Values inside parentheses, separated by commas (or semicolons in some locales).
Common Formula Examples You Can Use Today
Here are five practical examples that solve everyday problems. Copy them into your own sheet and adjust the cell references.
- Calculate a percentage change:
=(B2-A2)/A2formatted as a percentage. This shows the increase or decrease from old value (A2) to new value (B2). - Sum only if a condition is met:
=SUMIF(A2:A10, "Yes", B2:B10)adds values in B2:B10 where the corresponding cell in A2:A10 equals "Yes". - Look up a value from a table:
=VLOOKUP(D2, A2:B10, 2, FALSE)finds D2 in the first column of A2:B10 and returns the matching value from the second column. - Combine text with a line break:
=A2 & CHAR(10) & B2(enable wrap text on the cell to see the break). - Count unique items:
=SUMPRODUCT(1/COUNTIF(A2:A10, A2:A10))counts unique values in a range. Note: this can return a #DIV/0! error if there are empty cells.
How to Choose the Right Formula
Start by describing what you want in plain language. For example, "I want the total sales for the West region" → use SUMIF. "I want to find a product's price" → use VLOOKUP or XLOOKUP. "I want to check if a value is greater than 100" → use IF. If you're unsure, Excel's Insert Function dialog (fx button) lets you search by description. Also, the Formula Autocomplete dropdown shows syntax as you type.
Common Problems and How to Fix Them
Errors are part of learning. Here are the most frequent ones:
- #VALUE! – A function received the wrong data type. For example, adding text that looks like a number. Use
VALUE()to convert text to number. - #REF! – A cell reference is invalid, often after deleting a column or row. Undo or edit the formula to restore the reference.
- #NAME? – Excel doesn't recognize a function name. Check for typos, or if you used a name that isn't defined.
- #DIV/0! – Dividing by zero or an empty cell. Wrap with
IFERRORto show a friendly message. - Circular reference – A formula refers to its own cell, causing an endless loop. Excel will warn you; check the status bar for "Circular References".
Always test a formula with known values before relying on it. Use the Evaluate Formula tool (Formulas tab → Evaluate Formula) to step through the calculation.
Excel vs. Google Sheets: Formula Differences
Most formulas work identically in Excel and Google Sheets, but there are notable differences. Excel has XLOOKUP, while Sheets uses INDEX/MATCH (though Sheets now has XLOOKUP too). Array formulas in Excel require Ctrl+Shift+Enter (in older versions), while Sheets uses ARRAYFORMULA. Also, Sheets uses FILTER and SORT natively, while Excel's dynamic arrays handle these differently. If you switch between the two, test your formulas because subtle differences can cause errors.
Costs and Alternatives
Excel for Windows is part of Microsoft 365, which requires a subscription (typically monthly or annual). Alternatives include Google Sheets (free with a Google account), LibreOffice Calc (free and open-source), and Apple Numbers (free on Mac). These alternatives support most common formulas, but advanced features like Power Query or dynamic arrays may differ. For learning, all of them can handle the examples in this article.
Safety and Accuracy Tips
Formulas are powerful but can produce wrong results if misused. Always double-check your references, especially when copying formulas—relative references change, which might not be intended. Use absolute references where needed. Also, beware of hidden rows or filtered data: SUM includes hidden rows, while SUBTOTAL can exclude them. For financial or medical data, verify results with independent calculations. Excel is a tool, not a guarantee of correctness.
Frequently Asked Questions
How do I write a formula in Excel for Windows?
Click a cell, type =, then type the formula. For example, =A1+B1 adds two cells. Press Enter to confirm. You can also use the Formula Bar at the top of the sheet.
What is the difference between a formula and a function?
A formula is any expression that starts with =, like =A1*2. A function is a predefined formula, like SUM or IF, that takes arguments. All functions are formulas, but not all formulas use functions.
Why is my formula showing the text instead of the result?
Check that the cell is formatted as Text (Home → Number Format). If so, change it to General, then press F2 and Enter to recalculate. Also, make sure the formula starts with =, not a space or apostrophe.
How do I copy a formula down a column without changing the range?
Use absolute references with dollar signs, like =SUM($A$1:$A$10). Then copy the formula down. Alternatively, use Excel Tables (Insert → Table) so formulas auto-fill and references stay consistent.
What does #N/A mean in VLOOKUP?
It means the lookup value wasn't found in the first column of your table. Check for typos, extra spaces, or that the range is correct. Use IFERROR to display a custom message instead of the error.