How to Apply Conditional Formatting to Stock Price Changes in Excel
Question details
The user wants to set up conditional formatting rules to visually track whether imported stock prices have increased or decreased after refreshing the data.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking stock market data and visually indicating price fluctuations over time.
- Observed behavior
- The user aims to automatically display a green cell fill for price increases and a red cell fill for price decreases upon data refreshes.
Ensure your stock data import process is set up to record both the current and previous prices in separate cells, as Excel needs historical data points in the worksheet to calculate the difference.
Use Formula-Based Conditional Formatting for Price Changes
Set up a comparison formula in conditional formatting to dynamically highlight stock price increases in green and decreases in red.
To accurately highlight price changes, Excel requires both the previous stock price and the current stock price to be present in your worksheet. By comparing these two cells using a formula, Conditional Formatting can automatically apply the correct color whenever the data refreshes.
Ensure your worksheet has separate columns or rows for the 'Previous Price' (e.g., Column A) and 'Current Price' (e.g., Column B).
Highlight the cells containing the 'Current Price' that you want to format based on the changes.
Navigate to the 'Home' tab on the ribbon, click 'Conditional Formatting', and select 'New Rule' from the dropdown.
Choose 'Use a formula to determine which cells to format'. Enter a formula like =B2>A2 (assuming B2 is the current price and A2 is previous). Click the 'Format' button, go to the 'Fill' tab, select a green color, and click 'OK'.
Create another new rule following the same steps. This time, enter the formula =B2<A2, set the format to a red fill, and apply the rule.

Easily Track Stock Prices with WPS Spreadsheet
WPS Spreadsheet provides powerful and intuitive Conditional Formatting tools to help you visualize stock market trends. Apply custom formulas and cell highlighting instantly to stay on top of financial changes.
- 1. Open your file: Open your stock data spreadsheet (.xlsx or .csv) in WPS Spreadsheet.
- 2. Access Conditional Formatting: Select the cells you wish to track, navigate to the Home tab, and click on Conditional Formatting.
- 3. Create a new formula rule: Select 'New Rule' and choose the formula option to compare your current and previous price columns.
- 4. Apply highlight colors: Set your preferred green and red background fills for the increase and decrease logic, then apply the changes.

Frequently Asked Questions
Why is my conditional formatting not updating when I refresh the stock data?
If your formatting does not update, the data refresh might be completely overwriting the cells and wiping out previous prices. Ensure your import method shifts the old price to a dedicated comparison cell instead of just replacing the value.
Can I use icon sets (like arrows) instead of cell colors for stock changes?
Yes. In the Conditional Formatting menu, you can select 'Icon Sets' and choose directional arrows. You will need a helper column that calculates the difference (Current Price - Previous Price), and then apply the icon set to show an up arrow for positive numbers and a down arrow for negative numbers.
How do I highlight the entire row based on the stock price change?
To highlight the entire row, select the whole data table before creating your conditional formatting rule. Ensure you use an absolute column reference in your formula, such as =$B2>$A2, so the comparison formula stays locked to the price columns across the entire row.




