Unwalled

Module 3 · Lesson 1 of 3 · Beginner to intermediate

Conditional sums, lookups and fiscal dates

On this page

Learning objectives

  • Summarize financial records with explicit criteria.
  • Retrieve a rate using a validated key.
  • Separate lookup misses from formula defects and fiscal calendar differences.

Aggregate transactions and validate completeness

In Functions → Transactions, A is posting date, B region, C segment and D booked amount in USD thousands. There are four North/South entries of 60, 40, 30 and 20. North service contributes 60. SUM ignores text in referenced cells. AVERAGE includes zeros and ignores blanks. COUNT counts numeric values including dates, while COUNTA counts nonempty entries, including formulas returning an empty string. Compare counts with the source export before treating the total as complete.

SUMIF takes criteria range first, whereas SUMIFS takes the sum range first. Use equally shaped ranges. In actual exports, combine a date start inclusive and date end exclusive, so a timestamp on the final day is retained. COUNTIF counts a single condition and COUNTIFS uses AND across its pairs. Use IF with AND for tests that all must pass, or OR for any qualifying condition.

Syntax and expected results from the example ledger
FormulaResultAnalyst use
=SUM(D5:D8)150Foot all booked entries
=AVERAGE(D5:D8)37.5Average booking size
=MIN(D5:D8) / =MAX(D5:D8)20 / 60Spot outliers
=COUNT(D5:D8) / =COUNTA(B5:B8)4 / 4Find missing numeric inputs
=SUMIF(B5:B8,"North",D5:D8)100Single-region subtotal
=SUMIFS(D5:D8,B5:B8,"North",C5:C8,"Service")60Books matching both filters
=COUNTIF(B5:B8,"North")2Count North rows
=COUNTIFS(B5:B8,"North",C5:C8,"Service")1Count matched records
=IF(AND(COUNT(D5:D8)=4,SUM(D5:D8)=150),"Pass","Review")PassControl for completeness and total
=IF(OR(MIN(D5:D8)<0,COUNT(D5:D8)<4),"Review","Pass")PassIdentify negative or missing inputs under this case policy

Find rates and handle errors deliberately

INDEX returns the value at a position and MATCH finds the position of the key. MATCH's third argument of 0 requires an exact match. VLOOKUP with FALSE uses exact matching, requires the key in the first lookup column and uses a numeric return-column position that can drift after a layout change. XLOOKUP normally uses an exact match, can look to the left and can return a specific message for a miss. Excel 2016 and 2019 do not provide XLOOKUP. Use INDEX/MATCH for a shared file requiring those versions.

An exact match can still select the wrong record if the key is duplicated. Count matches first and investigate duplicates or zero matches. Set IFNA to catch an unmatched key where #N/A is expected. IFERROR catches broader failures, including #REF!, so blanket substitution with zero can hide lost source links. A calculation that cannot proceed should signal a visible review state and preserve the original diagnostic.

OFFSET returns a range shifted from a reference. INDIRECT interprets text as an address. Both are volatile in Excel and can obscure dependencies. INDIRECT references to closed external workbooks can fail. Prefer a table, INDEX or explicit ranges for core forecast links.

=INDEX(Transactions!$G$5:$G$6,MATCH("Service",Transactions!$F$5:$F$6,0))

=XLOOKUP("Service",Transactions!$F$5:$F$6,Transactions!$G$5:$G$6,"Missing")

=VLOOKUP("Service",Transactions!$F$5:$G$6,2,FALSE)

=IFNA(MATCH("Other",Transactions!$F$5:$F$6,0),"Missing key")

=IFERROR(1/0,"Review calculation")

=OFFSET(Transactions!D5,1,0)

=INDIRECT("Transactions!D5")

Align dates, fiscal periods and display

DATE(year,month,day) builds a numeric date. YEAR(serial_number) and MONTH(serial_number) extract calendar fields. EOMONTH(start_date,months) returns the end of a calendar month with the requested offset. YEARFRAC(start_date,end_date,basis) measures year fractions using a basis such as 3 for Actual/365 or 1 for Actual/Actual. Match the credit agreement or model convention. Keep a date-to-fiscal-year map for issuers on a 52/53-week calendar.

ROUND(number,num_digits) deliberately changes the computed value. Keep unrounded amounts feeding subtotals and round only when a contract or final deliverable requires it. Use SUMIFS on actual date boundaries when separate fiscal labels would hide mismatched periods. Confirm that imported dates are numbers before grouping.

=DATE(2026,2,1)

=YEAR(DATE(2026,2,1))

=MONTH(DATE(2026,2,1))

=EOMONTH(DATE(2026,2,1),0)

=YEARFRAC(DATE(2026,1,1),DATE(2026,4,1),3)

=ROUND(150/4,0)

Lesson glossary

1 term

Volatile function
A function Excel reevaluates when it recalculates even if its direct arguments have not changed.

Search the module glossary

Workbook exercise

Download the starter workbook (.xlsx)

Complete the Ledger formulas on Analysis. Derive the lookup with INDEX/MATCH and test XLOOKUP separately if your Excel version supports it. The Finance section belongs to the next lesson.

Unwalled does not store your workbook or your answers.

What is North service revenue, in USD thousands?

Practice questions

A lookup returns 35% and COUNTIF on the key returns 2. What is the next step?
What does YEARFRAC from Jan 1 to Apr 1, 2026, using basis 3 return?

Prepare to explain it aloud

Explain how to audit a lookup that returns a plausible rate · Define an exclusive fiscal-period end

Editorial references

Unwalled Finance Knowledge Library

  • Chapter 20 · Professional analyst workflow, Excel modeling and quality control