Highlight Cells Green With Conditional Formatting
Learn how to make Excel cells turn green when a condition is true, using a formula rule and exact green colour codes like 00B050.
If you want cells to turn green in Excel only when a number, date or status meets a condition, you need conditional formatting. It is a common need for tracking budgets, deadlines, test scores or inventory levels, where a quick colour cue beats scanning every row. Many people find the rule options confusing, and the green they get is often a preset shade that doesn't match their other colours.
This guide shows you how to set up a green fill that switches on only when your condition is true. You will learn the difference between a simple value rule and a formula rule, which green colour codes to use, and how to check that the rule works on every row. The steps apply to standard Excel spreadsheets, and a short section covers tables that start as PDFs.
How do you make a cell turn green when a condition is true? The short answer
Create a formula-based conditional formatting rule for the range, enter a formula that returns TRUE when the condition is met, and set the fill colour to green. For a precise shade, enter the colour code 00B050.
| Your situation | What to do | Why |
|---|---|---|
| Flag numbers above a threshold | Use a formula rule such as =B2>=100 | Excel checks each cell in the range against the condition |
| Flag a text status such as "Done" | Use =B2="Done" | Text in a formula must be wrapped in double quotes |
| Flag whole rows based on one column | Select the full row range and use =$C2="Late" | The dollar sign locks the column while the row number changes |
| Need the same green everywhere | Enter RGB 0, 176, 80 (hex 00B050) as the fill colour | An exact code gives you the same shade across sheets |
| Your table is in a PDF | Export it to Excel, then apply the rule | Conditional formatting only exists in spreadsheet files |
Before you start
Check these things first. Each one prevents a common reason for a rule that does nothing.
- Confirm the data type. Numbers stored as text will not match a numeric comparison like >=100. Select a cell and check whether the value aligns to the right, which usually means it is a number. If it aligns to the left, convert it before you write the rule.
- Decide what range to colour. Leave out the header row, or your header may turn green when the formula is true. A range such as B2:B200 is safer than the whole column because it avoids colouring blank cells.
- Note the exact condition in words. Write it out first, for example "green when the amount is 100 or more." Translating a sentence into a formula is much easier when you already know the threshold and the comparison.
- Pick your green. Excel offers several greens. Pure green (00FF00) is very bright and can make text hard to read. The standard Excel green 00B050 is easier on the eyes and is a good default. If your workbook uses a brand colour, get its code from whoever set the style.
- Keep an unchanged copy. Conditional rules are easy to change or delete by accident. Save a copy of the workbook before you add several rules to the same range.
Setting a green fill with a formula, step by step
- Select the range you want to colour. Click the first cell, then drag or Shift-click to the last one, such as B2:B200. The first cell of the selection is the anchor for your formula, so start with the cell that holds the first value.
- Open the conditional formatting options. Look for the conditional formatting command in the spreadsheet's formatting controls. Choose the option to create a new rule, then pick the rule type that lets you enter a formula.
- Enter a formula that returns TRUE or FALSE. Type a formula relative to the first selected cell, such as =B2>=100. Excel applies the same logic to each cell in the range, shifting the row number as it goes, so B3 is checked with B3>=100, and so on.
- Set the fill colour to green. In the format settings, choose the fill option and set the colour. For the standard Excel green, open the custom colour dialog and enter RGB 0, 176, 80, which is hex 00B050. A lighter option is a pale green fill with dark green text, which is easier to read on printed pages.
- Confirm the rule and check the range. Save the rule and confirm that the range in the rule matches your selection. If the rule covers the wrong cells, edit the range in the rule manager rather than rebuilding it.
- Test with sample values. Type one value above the threshold, one below and one exactly on the limit. The cell should turn green for the first and third, and stay plain for the second. If a value that should be green is not, see the checks below.
For a text rule, use the same steps with a formula such as =B2="Done". For a date rule, you can check whether a date has already passed by using a formula such as =TODAY()>B2, which turns a cell green once that date is behind today. TODAY() updates each time the workbook recalculates, so the colour can change without you editing anything.
Check the result
Once the rule is in place, run through this short list. Most problems show up here.
| Check | How to see it | If it's wrong |
|---|---|---|
| Green appears on the right cells | Scan the first, middle and last rows of the range | Check that the formula's cell reference matches the first cell of the selection |
| Values near the limit behave correctly | Compare a value equal to the threshold with one just below it | Use >= or > depending on whether the limit itself should count |
| Text matches | Look at a cell that should be green but is not | Check for extra spaces or a mismatch in capital letters, and confirm the text is in double quotes |
| Numbers are numbers | Select a cell and check its alignment or format | Convert text-stored numbers to numeric values before testing |
| Only one rule applies | Open the rule list for the range | Remove or reorder duplicate rules that set a different fill on the same cells |
If the green looks different on another computer, check whether the colour was set by name or by code. Named colours can look slightly different across themes, while an exact code such as 00B050 stays the same.
When your table starts as a PDF
Conditional formatting only works in a spreadsheet file, so a table in a PDF needs a conversion step first. The desktop client's PDF editor can export a PDF to Excel. After export, open the new workbook and check that each row and column landed in its own cells. Export depends on how the PDF table was built, so merged cells or tables drawn as plain lines may need manual cleanup before you add a rule.
Scanned PDFs are a special case. If the table is an image, the text has to be recognised first (OCR), and numbers may be misread. Check every value against the source before you apply a rule, because a misread digit will colour the wrong cell.
❓ FAQ
1. Which green should I use if 00B050 looks too dark?
Excel's standard Light Green is hex 92D050, which is a softer shade that works well for large tables. Open the custom colour dialog and enter the code to compare it with 00B050 on your own screen before you apply it to the whole range.
2. How do I remove a green rule I no longer need?
Open the rule manager for the sheet, select the rule that sets the green fill, and delete it. Cells keep their existing colour only while the rule is active, so removing the rule clears the green from every cell it covered.
3. Why do blank cells turn green when I use a "less than" rule?
Excel treats an empty cell as zero, so a test such as checking for values under 100 is true for every blank cell. Add a check that the cell is not empty, for example by combining the condition with a length test like =AND(LEN(B2)>0,B2>=100).
4. Can I colour cells green based on a value on another sheet?
Yes, a formula rule can refer to another sheet, but the reference must be written in the rule's formula with the sheet name. If the rule does not respond to changes on the other sheet, check that the sheet name is spelled exactly as it appears in the tab.
📝 Summary
To highlight cells green when a condition is true, use a formula-based conditional formatting rule with a fill of 00B050 and test the result on values above, below and at the threshold. Keep your range anchored to the first cell, quote any text in the formula, and convert a PDF table to Excel before you start if that is where your data lives.


