Function and Formulas in Excel: A Practical Guide

Master function and formulas in excel with practical, hands-on examples. From basics to advanced lookups and dynamic arrays, this guide helps aspiring and professional Excel users optimize data analysis tasks.

XLS Library
XLS Library Team
·5 min read
Excel Formulas - XLS Library
Photo by congerdesignvia Pixabay
Quick AnswerDefinition

Function and formulas in excel are the core tools for transforming raw data into insights. A function is a built-in calculation, while a formula combines cell values, operators, and functions to compute results. This guide demonstrates practical examples—from sums and averages to lookups and dynamic arrays—to help you work faster and more accurately.

What are functions and formulas in Excel?

At its heart, a formula is an expression you enter into a cell to compute a value. A function is a prebuilt calculation you can use inside a formula, such as SUM, AVERAGE, or VLOOKUP. Together, they enable arithmetic, data analysis, and automation across spreadsheets. Understanding how they interact—how references shift when you copy a formula, or when you lock a cell with $—is essential for reliable models. This section demonstrates the basics and existing patterns you will reuse frequently in day-to-day work.

Excel Formula
=SUM(A1:A10)

This simple formula adds all values in A1 through A10. For good practice, separate data and logic, keep inputs clean, and annotate formulas with comments where your workbook grows complex.

Getting started: building your first formula?

Learning to build formulas starts with a single equation and grows into a toolkit of reusable patterns. Start with a simple total, then introduce references, and finally add logic for robust models. Remember to check data types and ensure ranges are properly selected. As you gain confidence, you’ll migrate from hard-coded values to dynamic ranges that respond to your dataset.

Excel Formula
=SUM(B2:B20)

Input: a column of numbers in B2 to B20. Output: their sum. Also explore absolute vs. relative references to control how formulas copy across cells:

Excel Formula
=SUM($B$2:$B$20) // absolute range =SUM(B$2:B$20) // mix of absolute/relative

Core functions you should know

A solid Excel foundation relies on a handful of core functions. Start with SUM, AVERAGE, and COUNT to summarize data, then add MAX and MIN to identify extremes. These blocks form the backbone of most financial, scientific, and operational models. Use them on balanced data ranges and test edge cases (empty cells, text data).

Excel Formula
=SUM(A1:A10)
Excel Formula
=AVERAGE(A1:A10)
Excel Formula
=COUNT(A1:A10)

Tip: Use structured references in tables to automatically adapt ranges as data grows.

Conditional logic with IF and IFS

Conditional logic lets you tailor outcomes based on criteria. IF handles binary decisions, while IFS scales to multiple conditions. Practice with clear logical tests to avoid nested chaos. Here are representative patterns you’ll reuse across dashboards and reports.

Excel Formula
=IF(A2>50,"High","Low")
Excel Formula
=IFS(A2<50,"Low",A2<=100,"Medium",A2>100,"High")

If your criteria become complex, wrap tests with AND/OR for more control:

Excel Formula
=IF(AND(A2>10,A2<100),"OK","Check")

Common pitfall: misplacing quotes or failing to cover all possible outcomes, which yields FALSE results.

Lookup and reference: VLOOKUP, HLOOKUP, XLOOKUP, INDEX/MATCH

Lookups fetch data from other parts of a workbook by matching a key. Start with VLOOKUP for straightforward scenarios, but learn INDEX/MATCH for left-looking lookups and flexibility. XLOOKUP consolidates capabilities with simpler syntax. Practice with real data tables to internalize how each pattern behaves.

Excel Formula
=VLOOKUP(E2,Sales!A:B,2,FALSE)
Excel Formula
=INDEX(Sales!B:B, MATCH(E2, Sales!A:A, 0))
Excel Formula
=XLOOKUP(E2, Sales!A:A, Sales!B:B, "Not found")

Tip: VLOOKUP requires the lookup column to be the first column of the table array. INDEX/MATCH does not have this limitation.

Text, date, and logical functions

Text manipulation, dates, and logical flow are essential to modeling. Use TEXT to format dates/numbers, CONCAT or TEXTJOIN to assemble strings, and TODAY to anchor time-based calculations. These functions reduce manual formatting and keep your outputs consistent.

Excel Formula
=TEXT(A2,"yyyy-mm-dd")
Excel Formula
=CONCAT(A2," ",B2)
Excel Formula
=TODAY()

When date math is involved, remember that Excel stores dates as sequential numbers; adding 1 advances to the next day. This is critical for calculating aging, due dates, or service windows.

Array formulas and dynamic arrays (Excel 365)

Dynamic arrays simplify complex data transformations by allowing formulas to spill results into adjacent cells. Use FILTER to extract rows, SORT/UNIQUE to organize results, and SEQUENCE to generate numeric sequences for controlled analysis. These features dramatically reduce multi-step processes and improve readability.

Excel Formula
=FILTER(A2:D100, D2:D100>0)
Excel Formula
=UNIQUE(SORT(FILTER(A2:A100, B2:B100="Yes")))
Excel Formula
=SEQUENCE(5,1,1,1)

Note: If you’re on Excel versions without dynamic arrays, similar outcomes require helper columns or array-entered formulas with CTRL+SHIFT+ENTER.

Common pitfalls and best practices

A few practical cautions save hours: always test formulas on a small sample, avoid mixing data types in a single range, and prefer descriptive ranges (tables) over hard-coded A1 references. Decide early on absolute vs. relative references to prevent accidental miscopies. Document assumptions so future readers can follow your logic.

Excel Formula
=SUM($A$1:$A$12) // absolute range
Excel Formula
=SUM(A$1:A$12) // mixed reference

Common error: #VALUE!, #REF!, or #NAME?—check data types, ensure worksheet names exist, and verify spelling of function names in your locale.

How to troubleshoot formulas

Troubleshooting starts with auditing: evaluate individual parts, highlight referenced cells, and use the Formula Auditing tools. Create test sheets with representative values to isolate issues. When possible, break complex formulas into smaller steps to observe intermediate results. Consider using IFERROR to gracefully handle invalid inputs during debugging.

Excel Formula
=IFERROR(A2/B2, "Error: division by zero or invalid input")
Excel Formula
=EVALUATE("SUM("&A1:A5&")") // note: available in some environments or via named formulas

Pro tip: Use Show Formulas (Ctrl+`) to quickly view formulas instead of results; this helps locate inconsistencies across a workbook.

Steps

Estimated time: 60-90 minutes

  1. 1

    Prepare data and a sandbox sheet

    Create a dedicated sheet with sample data for numbers, dates, and text. Organize columns to reflect common fields (e.g., Sales, Date, Product).

    Tip: Label columns and use data validation to avoid inconsistent inputs.
  2. 2

    Create a simple sum formula

    In a separate cell, enter =SUM(B2:B20) to see the total. Verify the result against a manual check.

    Tip: Use the status bar to quickly verify sums for large ranges.
  3. 3

    Add conditional logic

    Use an IF formula to categorize results, such as =IF(A2>50,'High','Low').

    Tip: Combine IF with AND/OR for multi-condition rules.
  4. 4

    Experiment with lookup

    Populate a small lookup table and fetch values using VLOOKUP or INDEX/MATCH.

    Tip: Prefer INDEX/MATCH to support left lookups and flexible data layouts.
  5. 5

    Try dynamic arrays (where available)

    Use FILTER to extract rows that meet a criterion, then wrap with UNIQUE.

    Tip: Dynamic arrays simplify complex data extraction and cleaning.
  6. 6

    Audit and document

    Review formulas for absolute references and add comments or a separate sheet with explanations.

    Tip: Keep formulas readable for teammates.
Pro Tip: Organize data into tables to automatically adjust ranges with new rows.
Warning: Be careful with mixing data types in a single column; it can cause #VALUE! errors.
Note: Enable Show Formulas to quickly audit complex workbooks.

Prerequisites

Required

Keyboard Shortcuts

ActionShortcut
CopyCopy selected cell or rangeCtrl+C
PastePaste into target cellCtrl+V
Show formulasToggle formula view to audit syntaxCtrl+`

People Also Ask

What is the difference between a function and a formula?

A function is a built-in operation like SUM or AVERAGE. A formula is a user-defined expression that may include constants, cell references, operators, and functions.

A function is a ready-made calculation; a formula is your complete expression that uses one or more functions.

How do I reference cells correctly when copying formulas?

Use absolute references with the $ symbol to lock rows or columns, ensuring copied formulas maintain intended references.

Lock the parts you don’t want to move when you copy a formula.

When should I use VLOOKUP vs INDEX/MATCH vs XLOOKUP?

VLOOKUP is simple for quick fetches but limited. INDEX/MATCH is flexible and left-friendly. XLOOKUP combines features for modern datasets.

INDEX/MATCH is often the most flexible; XLOOKUP is simpler for new workbooks.

What are dynamic arrays and how do I use them?

Dynamic arrays spill results into adjacent cells, simplifying formulas like FILTER, SORT, and UNIQUE on compatible Excel versions.

Dynamic arrays let results spill automatically to nearby cells.

How can I test formulas safely?

Create a test sheet or copy of your data to try formulas before applying them to live data.

Always test formulas on a copy to avoid affecting real data.

The Essentials

  • Master core functions: SUM, AVERAGE, COUNT
  • Use IF/IFS for conditional logic
  • Leverage LOOKUPs for data retrieval
  • Explore dynamic arrays where supported
  • Audit formulas with built-in tools

Related Articles