Skip to content

Excel formulas: choose a function and check the result

Use the result you need to choose a formula. This guide includes complete data and checked answers so you can practise conditional totals, counts, references and lookups.

Choose an Excel function from the result you need: a total, a count, a rule, a matching record or a cleaned value. Then check the inputs, references and a known answer before copying the formula through a workbook.

Your task Useful starting point
Total numeric values SUM
Total or count records matching conditions SUMIFS or COUNTIFS
Choose a result from a logical test IF; IFS for several ordered tests
Retrieve a matching record XLOOKUP where supported; INDEX/MATCH or VLOOKUP where appropriate
Handle an expected missing lookup The lookup’s not-found option or IFNA
Explain an unexpected error Inspect the source and references before hiding it

References: what the dollar sign fixes

When copied, B2 can change both row and column. $B$2 keeps both fixed; B$2 fixes the row; $B2 fixes the column. An absolute reference is fixed for copying, not a promise that structural edits can never change it. Microsoft explains the distinction in its reference guide.

For a quantity in B2 and a shared rate in E2, use =B2*$E$2, then check the next copied row. Tables and named ranges can make formulas easier to read, but they do not make errors impossible. Microsoft’s Name Manager guidance includes names containing errors; its #REF! guidance explains invalid references.

A complete SUMIFS and COUNTIFS example

Enter this fictional data in A1:D7. Amount is a number, not text containing a currency symbol.

Order Region Status Amount
A101 West Completed 1200
A102 East Completed 800
A103 West Cancelled 600
A104 West Completed 300
A105 East Completed 450
A106 West Completed 200

Total completed West orders:

=SUMIFS(D2:D7,B2:B7,"West",C2:C7,"Completed")

The result is 1700: 1200 + 300 + 200. Count the same records:

=COUNTIFS(B2:B7,"West",C2:C7,"Completed")

The result is 3. Both conditions must hold for a row to contribute. The cancelled 600 is excluded. Microsoft documents the argument order for SUMIFS and COUNTIFS.

Test an edit: change A106’s status to Cancelled. The completed West total should become 1500, and the count 2. Restore it before comparing with the original answers. Use equal-sized criteria and sum ranges, and extend every range together when adding rows. An Excel Table offers another way to manage an expanding source.

IF and IFS: write the rule first

For a fictional review threshold, =IF(D2>=1000,"Review","Routine") returns Review for 1200 and Routine for 800. Test exactly 1000 as well: the >= operator includes it.

Use the IFS lesson when there are several ordered conditions. It includes full data, default handling and boundary tests. A long list of changeable thresholds may be clearer in a small lookup table than embedded in a formula.

Lookups: compatibility and matching matter

XLOOKUP versus INDEX MATCH shows complete exact, missing, duplicate and two-way examples. XLOOKUP is convenient in supported current Excel versions. INDEX/MATCH and VLOOKUP remain useful when the workbook or its users require them. There is no need to rewrite a working formula solely because another function is newer.

With VLOOKUP, choose exact matching deliberately when required; with MATCH, 0 requests exact matching. Check what should happen when the key is absent or duplicated. Use a total such as SUMIFS when the requirement is to aggregate several matching records rather than select one.

Keep unexpected errors visible

IFERROR replaces many kinds of errors, not only a missing lookup. Use it only when that broad fallback is appropriate. A broken reference, a number stored as text and a legitimately missing code need different fixes. Record the original error while investigating rather than converting every failure into zero.

Practice and choose a course

Download the Excel practice pack for editable sample data, formulas and answer checks. Compare Excel Advanced Functions for conditional logic and summaries, or Expert Functions for further formula work. PivotTables and slicers are covered in Advanced Data Management.