How to Create an Excel In-Cell Bar Showing Position in a Range
Question details
The user wants to visually represent where a specific value (such as a stock price) falls between a 52-week low and high range using an in-cell bar and a percentage formula.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Visualizing financial data or stock prices to immediately see a value's relative position within a set minimum and maximum range.
- Observed behavior
- The user needs to display a visual data bar inside a cell and accurately calculate the percentage position of the price within the given range.
Ensure your data is organized into clear columns (e.g., Stock Name, Current Price, and Range) so that you can easily reference these cells when setting up your conditional formatting rules and calculation formulas.
Use Conditional Formatting Data Bars and Formulas
Use Excel's Data Bars feature combined with a simple calculation to create a visual progress bar directly inside your spreadsheet cells.
In-cell data bars are an excellent way to create mini-charts within a single cell. By setting custom minimum and maximum rules, you can accurately map a value's position against a target or historical range.
Arrange your data into dedicated columns. For a stock tracker, set up columns such as 'Stock', 'Price', and 'Range' (the difference between the 52-week high and low).
Select the cells in your 'Price' column. Navigate to the 'Home' tab on the Excel ribbon, click on 'Conditional Formatting', hover over 'Data Bars', and select 'More Rules'.
In the New Formatting Rule dialog box, ensure the format style is set to 'Data Bar'. Choose a solid fill color of your preference. Under the Minimum and Maximum settings, change the type from 'Automatic' to 'Number' or 'Formula', and input your specific range limits.
To numerically show the position within the range, add a new column for Percentage. Enter a formula such as `=B2/C2*100` (assuming B2 is your current price and C2 is the defined range), and press Enter to display the percentage.

Create Stunning In-Cell Data Bars with WPS Spreadsheet
WPS Spreadsheet offers powerful, easy-to-use conditional formatting tools that are perfectly compatible with Excel. You can quickly create dynamic in-cell data bars and calculate percentage ranges to build professional financial dashboards.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your stock or range data.
- 2. Select your target cells: Highlight the column where you want the visual in-cell bars to appear.
- 3. Apply Data Bars: Go to the Home tab, click 'Conditional Formatting', select 'Data Bars', and choose 'More Rules'.
- 4. Customize and apply: Set your custom minimum and maximum values, pick a solid fill color, and click OK to instantly visualize your data.

Frequently Asked Questions
Can I hide the numbers and only show the data bar in the cell?
Yes. When setting up or editing the Data Bar in the 'More Rules' dialog box, simply check the 'Show Bar Only' box. This will hide the numerical cell value and only display the visual color bar.
Why do my Excel data bars look disproportionate?
This usually happens when the minimum and maximum values are left on 'Automatic', causing Excel to evaluate the bars relative only to the data present. To fix this, edit the conditional formatting rule and manually set the Minimum and Maximum types to 'Number' or 'Formula'.
Does conditional formatting update automatically if the stock price changes?
Yes, both Excel and WPS Spreadsheet will automatically adjust the length and color of the data bar the moment the referenced cell value or formula calculation changes.
How do I format data bars to show negative values differently?
In the 'More Rules' window for Data Bars, click the 'Negative Value and Axis' button. From there, you can specify a distinct fill color (such as red) and choose how the axis is displayed for negative numbers.




