
Excel Automatic Dashboard: Automatically Refresh KPI Cards and Sparklines with WRAPROWS and VSTACK
Create a dashboard where KPIs and trends automatically refresh when data is added, using only dynamic array spills (#), WRAPROWS/VSTACK, and SPARKLINE. Copy and paste the example to reproduce it immediately.
Quick Fix: Finish in 10 Minutes
- Convert the source data into a table (Sales) with Ctrl+T.
- Create the daily totals spill (HSTACK) starting in cell
J2. - Calculate four KPIs and create a two-column table with
WRAPROWS. - Create a 14-day trend with
SPARKLINE. - Link all charts/tables with
=Sheet!StartCell#.
Sample Data (Sales)
| Date | Channel | Category | Item | Qty | Revenue |
|---|---|---|---|---|---|
| 2025-08-26 | Online | Tops | T002 | 2 | 65000 |
| 2025-08-26 | Online | Shoes | S101 | 1 | 120000 |
| 2025-08-27 | Store | Shoes | S102 | 2 | 240000 |
| 2025-08-28 | Online | Outer | O010 | 1 | 159000 |
| 2025-08-29 | Online | Tops | T003 | 5 | 165000 |
| 2025-08-30 | Online | Bottoms | B021 | 2 | 78000 |
| 2025-08-31 | Online | Shoes | S201 | 1 | 140000 |
Daily Totals Spill
=LET(
d, SORT(UNIQUE(Sales[Date])),
rev, MAP(d, LAMBDA(x, SUM(FILTER(Sales[Revenue], Sales[Date]=x)))),
ord, MAP(d, LAMBDA(x, SUM(FILTER(Sales[Qty], Sales[Date]=x)))),
HSTACK(d, rev, ord)
)
Four KPI Cards
=SUM(Sales[Revenue])
=SUM(Sales[Qty])
=SUM(Sales[Revenue]) / SUM(Sales[Qty])
=LET(end,TODAY(), cur,SUM(FILTER(Sales[Revenue], Sales[Date]>end-7)),
prv,SUM(FILTER(Sales[Revenue], (Sales[Date]<=end-7)*(Sales[Date]>end-14))), IF(prv=0,1,(cur-prv)/prv))
Lock the Layout with WRAPROWS
=LET(flat, {"Total Revenue",SUM(Sales[Revenue]),"Orders",SUM(Sales[Qty]),"AOV",SUM(Sales[Revenue])/SUM(Sales[Qty]),"7d vs prev7d",LET(end,TODAY(),cur,SUM(FILTER(Sales[Revenue],Sales[Date]>end-7)),prv,SUM(FILTER(Sales[Revenue],(Sales[Date]<=end-7)*(Sales[Date]>end-14))),IF(prv=0,1,(cur-prv)/prv))}, WRAPROWS(flat,2,""))
Sparkline
=LET(d,SORT(UNIQUE(Sales[Date])), r,MAP(d,LAMBDA(x,SUM(FILTER(Sales[Revenue],Sales[Date]=x)))), r14,TAKE(r,-14), SPARKLINE(r14))
Combine Blocks with VSTACK
=VSTACK({"KPI","Value"}, KPI1, {"Top 5 Categories","Revenue"}, TopTbl, {"Date","Revenue","Orders"}, J2#)
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Only part of the chart appears | Fixed cell reference | Link it to the starting cell with # |
| #SPILL! | Spill range overlap | Clear the range |
| Date axis is broken | Text dates | Use –Date or change the format |
| AOV error | Zero denominator | Use an IF branch |
Conclusion
An automatic dashboard can be completed with WRAPROWS, VSTACK, and SPARKLINE alone. The next article continues with automating a card-style KPI layout.