Logan's Analytics Bootcamp
Dashboard β€Ί Phase 1: Advanced Excel
M1.3

LET and LAMBDA, Reusable Logic

⏱ 5 hoursπŸ“… Weeks 3–4❓ 4 quiz questions
Phase 1 goal

Turn Excel from a calculation grid into a repeatable data pipeline: clean data with Power Query, look up and reshape with modern functions, wrap logic in LET/LAMBDA, and summarize with PivotTables on a Data Model.

🎯 Learning objectives

Tick each one when you can actually do it.

πŸ’‘ Key concepts

  • LET: =LET(name1, value1, name2, value2, calculation). Each value is calculated once.
    =LET(
       ev,  SUMIFS(EVM[BCWP], EVM[ProgramID], A2),
       ac,  SUMIFS(EVM[ACWP], EVM[ProgramID], A2),
       IF(ac=0, "", ev/ac)
    )
    
  • LAMBDA: =LAMBDA(param1, param2, calculation). Test it in a cell by calling it immediately: =LAMBDA(x, x+1)(1). Then save it in Formulas β†’ Name Manager with a clear name and comment.
  • Useful program LAMBDAs:
    • CPI_SAFE = LAMBDA(ev, ac, IF(ac=0, NA(), ev/ac))
    • RAG = LAMBDA(idx, IFS(idx>=0.95,"Green", idx>=0.90,"Amber", TRUE,"Red")) (illustrative thresholds. Use your organization's.)
    • FY = LAMBDA(d, YEAR(d)+(MONTH(d)>=10))
    • WORKDAYS_SLIP = LAMBDA(base, fcst, NETWORKDAYS(base, fcst) - 1)
  • Helpers:
    • SCAN(0, range, LAMBDA(acc, x, acc + x)) gives a running cumulative (current-period EVM β†’ cumulative)
    • BYROW(array, LAMBDA(r, ...)) returns one result per row
    • MAP(arr1, arr2, LAMBDA(a, b, ...)) works element by element
    • REDUCE collapses to a single value
  • Documentation habit: Put a comment in every Name Manager entry, since teammates need to know what RAG() does.

πŸ›  Hands-on exercise: EVM Function Library

⬇ Practice data for this module
D3 evm_monthlyMonthly EVM by control account (~2,000 rows)CSVXLSX

Data: evm_monthly filtered to PRG-005 (PeriodEnd, BCWS, BCWP, ACWP, BAC).

  1. Sort by PeriodEnd. Use SCAN to create cumulative BCWS, BCWP, and ACWP spills.
  2. Create Name Manager LAMBDAs: CPI_SAFE, SPI_SAFE, EAC_CPI(bac, cumEV, cumAC) = bac / CPI_SAFE(cumEV, cumAC), TCPI(bac, cumEV, cumAC) = (bac - cumEV)/(bac - cumAC), RAG(idx).
  3. Use MAP with your LAMBDAs to produce monthly CPI, SPI, and RAG spills.
  4. Rewrite one long nested-IF formula from your own workbook (using fictionalized values) with LET.

πŸ“¦ Mini-project: "EVM in One Cell"

Build one LET formula that takes a ProgramID (input cell) and returns a 1Γ—6 horizontal array: cumulative BCWP, ACWP, CPI, SPI, EAC (BAC/CPI), VAC. Then wrap it as a LAMBDA called EVM_SNAPSHOT(programID) and use it with BYROW (or MAP) to fill a 12-program table. Document it in Name Manager.

🧠 Self-check quiz

Answer in your own words, then check. Grade yourself honestly; your score is saved.

Q1.3.1
Name two benefits of LET.
Write at least a few words to unlock.
Q1.3.2
Why does =LAMBDA(x, x*2) typed in a cell return #CALC!?
Write at least a few words to unlock.
Q1.3.3
Which helper would you use to turn monthly ACWP into cumulative ACWP?
Write at least a few words to unlock.
Q1.3.4
Write a TCPI LAMBDA (to BAC).
Write at least a few words to unlock.