In-Cell Bar Charts in Excel: REPT, Data Bars and Sparklines

In-Cell Bar Charts in Excel: REPT, Data Bars and Sparklines

📎 This article includes 1 downloadable practice file ↓

⏱ 2 min readUpdated 27 September 2026

Big charts take space and need resizing. For dashboards and reports, charts inside the cells are often clearer: every row carries its own little visual.

In this article
  1. 1. The REPT formula trick
  2. 2. Conditional formatting Data Bars
  3. 3. Sparklines for trends
  4. Which to choose?
  5. Try it yourself: step by step

1. The REPT formula trick

=REPT("█", ROUND(B2 / MAX($B$2:$B$20) * 20, 0)) & " " & TEXT(B2, "#,##0")

REPT repeats a character. We scale each value against the maximum so the longest bar is 20 blocks, then append the number. Use a monospaced font such as Consolas so bars line up, and colour the cell font to match your theme.

💡 Other characters give different styles: "|" for thin bars, "●" for dot plots, "★" for ratings — e.g. =REPT("★",C2)&REPT("☆",5-C2).

2. Conditional formatting Data Bars

  1. Select the numbers.
  2. Home → Conditional Formatting → Data Bars and pick a solid fill.
  3. Optional: Manage Rules → Edit → Show Bar Only for a clean bar without the number.

Data Bars handle negative values (they draw left of an axis) and resize automatically as values change.

When each row has a series — monthly sales per rep — a sparkline shows the trend in one cell:

  1. Select the empty cells next to the data.
  2. Insert → Sparklines → Line, and choose the month range.
  3. Under the Sparkline tab tick High Point and Low Point to highlight extremes.

Which to choose?

Need Best option
Works everywhere, even in exported CSV/text REPT formula
One value per row, quick visual ranking Data Bars
A trend over time per row Sparklines

Combine them with SORTBY and TAKE (see the Formula Lab) for a self-updating Top 10 table with bars.

Try it yourself: step by step

  1. Download in-cell-charts.xlsx.
  2. Column C draws bars with REPT("█", …). Change a value in column B and watch its bar grow or shrink.
  3. Column D shows the same numbers with a conditional-formatting Data Bar — select D2:D7 → Home → Conditional Formatting → Manage Rules to see the rule.
  4. Change a rating in column E between 1 and 5 — the stars in column F update.
  5. Add sparklines yourself: select an empty column, Insert → Sparklines → Column, and point it at B2:B7.

📎 Practice files for this article

  • 📗
    In-cell charts workbookREPT bars, Data Bars and star ratings with live formulas.
    ⬇ XLSX · 6 KB

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.