Skip to main content

How to shade a cell based on another cell value in Excel?

Supposing you want to shade a cell (says A1) with a certain background color if cell B4 meets the criteria such as has a certain value or the value is greater or less than a specific number. What would you do? This article will show you the method.

Shade a cell based on another cell value with Conditional Formatting


Shade a cell based on another cell value with Conditional Formatting

You can do as follows to shade a cell based on another cell value in Excel.

1. Select the cell (says A1) you want to shade based on another cell value, then click Conditional Formatting > New Rule under the Home tab.

2. In the New Formatting Rule dialog box, you need to:

  • 2.1 Select Use a formula to determine which cells to format option in the Select a Rule Type box;
  • 2.2 If you want to shade cell A1 when value of B4 is greater than 500, then enter formula =$B4>500 into the Format values where this formula is true box;
    Tips: if you want to shade cell A1 when B4 has a certain value such as “test”, the use this formula =$B4=“test”. You can change the variable in the formula based on your needs.
  • 2.3 Click the Format button to specify a background color;
  • 2.4 Click the OK button when it returns to the New Formatting Rule dialog box. See screenshot:

Then you can see the specified cell is shaded based on the value of another cell as below screenshot shown.


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (17)
Rated 4 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
I just wanted to leave my experience after reading the comments left here when in need of accomplishing entire columns needing to correlate to their respective rows under another column.
I hope I can help out the community for anyone else in search for answers with the same needs as I had.

This example is if you need each cell to act independently according to a cell in its own respective row. For example: Looking at row 4 I need my cell in column H to change color based on a value in column F (still in row 4). Lets say in this case I need H4 to change when the word Complete is entered in F4. (But I need this rule to apply for all rows. -Lets say I have 104 rows total.)

Conditional Formatting: New Rule > "Use a formula to determine which cells to format" - Format values where this formula is true: (enter the following) =$F1:$F104="Complete" (-Choose Format desired)
(We now need to add the cells this new rule applies to, enter the following) =$H$1:$H$104 > Apply > OK

You should now have independent rows formatting cells in column H dependent on the value "Complete" being entered in cells in column F.
Rated 4 out of 5
This comment was minimized by the moderator on the site
I have two column Buy Units (A) and Sell unites (B). When typing sell units B column, If B1>A1 return red font in B1 value. (To say that there is typo= you can not sale more unit than you have got) FOR EACH TRANSACTIONS. Meaning same to be applied for B2>A2, B3>A3., B4>A4... I do not want to keep typing Conditional Formating for each single cell, just want to COPY and Paste. This seems relatively easy ask but taking me a toll! Can you please help?
This comment was minimized by the moderator on the site
Yes I want learn/ know this
This comment was minimized by the moderator on the site
How do I solve this ?
Say I have 5 Columns - CORRECT_ANS, PERSON1, PERSON2, PERSON3, PERSON4
and say 4 rows with values as below.

CORRECT_ANS, PERSON1, PERSON2, PERSON3, PERSON4
A B C A A
B A B D B
C C C A B
C A D C C

Values in Columns PERSON1 to PERSON4 should match against corrresponding row in CORRECT_ANS. If value is same, then Cell color to be GREEN, else RED.
So in 1st case, PERSON3 and PERSON4 cell should be GREEN, rest RED. Similarly 2nd row, PERSON2 and PERSON4 gets GREEN, rest RED, and so on.
This comment was minimized by the moderator on the site
what if I want a cell to be shaded based on the presence or absence of text in a different cell?
This comment was minimized by the moderator on the site
If you want the condition to format several cells on the same row, select them all and use the formula =$J1="your_text_here"
This comment was minimized by the moderator on the site
HI what if I want to condition a cell based on the presence or not of text in a different cell?
This comment was minimized by the moderator on the site
To apply this to multiple rows, use the same formula (Excel automatically continues the formula with relative values).
e.g. for the following sheet,
_|_A_B
1| 0 0
2| 0 1
3| 1 0
4| 1 1
to make A1 depend on B1, and A2 depend on B2, and so forth, use =$B1=0. To make all the cells in A depend on one cell in B, use =$B$1=0, and to make the cells in A depend on the cells in the next row of B, use =$B2=0 (with the A cells selected from A1).
This comment was minimized by the moderator on the site
Ho do I apply this rule by row
For example, I want Cell I2 to be formatted by G2. I3 by G3 and so on
This comment was minimized by the moderator on the site
Hey for doing it by row, let's say I want to make A red when B > 0.

For that I would go to A, and enter the formula =B:B > 0

That's how you would do this
This comment was minimized by the moderator on the site
Hi,
I want to dpo the following. Help me out.
A1 to be green if B1>0
A2 to be green if B1>0
.
.
.
.
A250 to be green if B250>0

I am unable to copy the formula to all the rows.
This comment was minimized by the moderator on the site
How can we apply the rule on multiple cells with a single formula? Applying the rule on every single cell will be a hectic job.
This comment was minimized by the moderator on the site
How might i format column N to be shaded according to value in column L? (Eg higher red, lower blue, equals green, no value - no shading)
Can i write a formula for column N in conditional formatting?

K L M N
DD 0.2 0.8

AM 0.8 1.0

TB 1.0 1.0

AM 1.0 1.0

TB 0.6 0.8

AM 0.4 0.4

AM 0.8 0.8


Any help appreciated
D
This comment was minimized by the moderator on the site
Hi Deb,
Sorry can't help you with that. Thank you for your comment.
This comment was minimized by the moderator on the site
Hey Deb and Crystal,

For doing it by row, let's say I want to make A red when B > 0.

For that I would go to A, and enter the formula =B:B > 0

That's how you would do this
This comment was minimized by the moderator on the site
i want to know formula for color change of cell on basis of two different cell values
This comment was minimized by the moderator on the site
Hi Manish,
Please try this formula =AND($A2="KTE", $B2>100)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations