You can make a bar chart inside a single Excel cell using the REPT function, which repeats a character a set number of times. The formula =REPT("|", value) turns a number into a visual bar of pipe characters, so a value of 10 becomes ||||||||||. This is an in-cell chart, not a floating chart object, so it stays inside the cell and moves with your data. It works in Excel for Microsoft 365, Excel 2021, 2019 and 2016 on Windows and Mac, and in Excel for the web. No add-ins are needed.

What You'll Need

  • Excel for Microsoft 365, Excel 2021, 2019 or 2016 (Windows or Mac), or Excel for the web.
  • A column of numeric values to chart.
  • A font that shows block characters clearly, such as Calibri or Arial. The pipe character | and the block █ both work.

Step-by-Step

  1. Enter your numbers in a column, for example A2:A10. Leave the cell to the right of each number empty for the chart.
  2. Click the first empty cell next to your first number, such as B2.
  3. Type this formula: =REPT("|",A2) and press Enter. The cell now shows one pipe per unit of the value in A2.
  4. Drag the fill handle (the small square at the bottom-right corner of B2) down to the last row of your data. Each cell now shows a bar sized to its number.
  5. To make the bars easier to read, select the chart cells and change the font to a monospaced font such as Consolas or Courier New. The bars then line up evenly.
  6. To scale the bars so the longest one fits the cell width, divide each value by the maximum. In C2 type =REPT("|",ROUND(A2/MAX($A$2:$A$10)*20,0)) and fill down. The 20 is the maximum number of characters per bar; change it to fit your column width.
  7. To add a label, put the number in a cell to the right of the bar, or use a formula such as =REPT("|",A2)&" "&A2 to show the bar and the value together.
  8. If you want a solid bar instead of pipes, use the block character █ in the formula: =REPT("█",A2). Copy and paste the block character from a character map or type it with Alt+2588 on Windows.

Common Mistakes

  • Using a proportional font such as Calibri for pipe bars: the bars look uneven. Switch to a monospaced font.
  • Forgetting the absolute reference $A$2:$A$10 in the MAX formula, so the scale changes as you fill down.
  • Letting the bar overflow the cell: the text spills into empty cells to the right. Widen the column or reduce the maximum character count.
  • Using negative numbers: REPT returns an error for a negative count. Wrap the value in ABS or handle negatives separately.
  • Expecting the in-cell bar to update like a chart object: it recalculates when the source value changes, but it is text, so it cannot be formatted with axes or legends.

Tips

  • Use conditional formatting's Data Bars instead if you want a shaded bar that fills the cell background. Select the cells, then go to Home > Conditional Formatting > Data Bars. This is a real Excel feature and needs no formula.
  • Keep the maximum character count at or below the column width in characters so bars never spill.
  • Use ROUND to avoid long decimal counts; REPT needs a whole number.
  • For a quick visual, the pipe character is easiest to type; the block character looks cleaner but must be copied or typed with an Alt code.

Troubleshooting

  • The cell shows #VALUE!: the count argument is negative or not a number. Check the source cell and wrap it in ABS if needed.
  • The bars look ragged: the font is proportional. Select the cells and choose Consolas, Courier New or another monospaced font.
  • The bar is cut off: the column is too narrow. Widen it or lower the multiplier in the formula.
  • Nothing appears: the source value may be 0 or blank. REPT with a count of 0 returns an empty string.
  • The formula does not fill down correctly: check that relative references (A2) and absolute references ($A$2:$A$10) are used where intended.

Frequently Asked Questions

Can I make a real chart inside a single cell?

No. Excel charts are floating objects that sit above cells. The in-cell method uses text characters to imitate a bar, and conditional formatting Data Bars shade the cell background. Both are cell-level visuals, not chart objects.

Does this work in Excel for the web?

Yes. REPT and conditional formatting Data Bars work in Excel for the web, though the exact menu labels can differ slightly by version and region.

What is the difference between REPT bars and Data Bars?

REPT bars are text characters you control with a formula. Data Bars are a conditional formatting fill that shades the cell background and scales automatically. Data Bars are usually easier and look cleaner.

Can I use a different character for the bar?

Yes. Any single character works, such as |, █, # or *. Use a monospaced font so the bars align.

Why does my bar show fewer characters than the value?

The cell may be too narrow and the text is spilling or being clipped. Widen the column or reduce the multiplier in the formula.

Can I make a horizontal bar chart in a cell?

The REPT method produces a horizontal bar by repeating a character across the cell. For vertical bars you would need a different approach, such as a sparkline column chart, which is available in Excel 2010 and later.