Dashboard βΊ Phase 1: Advanced Excel
M1.3
LET and LAMBDA, Reusable Logic
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 rowMAP(arr1, arr2, LAMBDA(a, b, ...))works element by elementREDUCEcollapses 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
Data: evm_monthly filtered to PRG-005 (PeriodEnd, BCWS, BCWP, ACWP, BAC).
- Sort by PeriodEnd. Use
SCANto create cumulative BCWS, BCWP, and ACWP spills. - 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). - Use
MAPwith your LAMBDAs to produce monthly CPI, SPI, and RAG spills. - 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.
Model answer
How did you do?
Q1.3.2
Why does
=LAMBDA(x, x*2) typed in a cell return #CALC!?Write at least a few words to unlock.
Model answer
How did you do?
=LAMBDA(x,x*2)(5), or save it as a named function and call it by name.Q1.3.3
Which helper would you use to turn monthly ACWP into cumulative ACWP?
Write at least a few words to unlock.
Model answer
How did you do?
SCAN, with an accumulator: =SCAN(0, ACWP_range, LAMBDA(a, x, a + x)).Q1.3.4
Write a TCPI LAMBDA (to BAC).
Write at least a few words to unlock.
Model answer
How did you do?
=LAMBDA(bac, ev, ac, (bac-ev)/(bac-ac))