Excel Automatic Dashboard: Automatically Refresh KPI Cards and Sparklines with WRAPROWS and VSTACK

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

  1. Convert the source data into a table (Sales) with Ctrl+T.
  2. Create the daily totals spill (HSTACK) starting in cell J2.
  3. Calculate four KPIs and create a two-column table with WRAPROWS.
  4. Create a 14-day trend with SPARKLINE.
  5. Link all charts/tables with =Sheet!StartCell#.

Sample Data (Sales)

DateChannelCategoryItemQtyRevenue
2025-08-26OnlineTopsT002265000
2025-08-26OnlineShoesS1011120000
2025-08-27StoreShoesS1022240000
2025-08-28OnlineOuterO0101159000
2025-08-29OnlineTopsT0035165000
2025-08-30OnlineBottomsB021278000
2025-08-31OnlineShoesS2011140000

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

IssueCauseSolution
Only part of the chart appearsFixed cell referenceLink it to the starting cell with #
#SPILL!Spill range overlapClear the range
Date axis is brokenText datesUse –Date or change the format
AOV errorZero denominatorUse 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.

Leave a Reply

Your email address will not be published. Required fields are marked *