FormulaCraft

How to make an in-cell bar chart with REPT in Excel and Google Sheets

Excel & Google Sheets
=REPT("|",A2)

Verified example

Computed by a real spreadsheet engine on the sample data below.

ValueBar
5
8
3

=REPT("|",A2)|||||

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter your numeric values in column A (e.g., sales figures or scores from 0–100).
  2. 2In column B, enter =REPT("|",A2) to repeat the pipe character once per unit — or scale it: =REPT("|",ROUND(A2/10,0)) to keep bars compact.
  3. 3Set the font of column B to a monospace font like Courier New for evenly spaced bars.
  4. 4Apply a color fill or font color to the bar column to make it visually distinct — red, green, or blue work well.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

How do I scale my bars so large numbers don't overflow the cell?

Divide by a scaling factor: =REPT("|",ROUND(A2/MAX($A$2:$A$10)*20,0)) makes the longest bar exactly 20 characters.

Can I use REPT for a percentage bar?

Yes — if your value is a percentage (0–1), use =REPT("█",ROUND(A2*20,0))&REPT("░",ROUND((1-A2)*20,0)) for a filled+empty bar.

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: