Different Rules in Excel

Tomexcel2022

New Member
Joined
May 25, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have a cell that is a drop down list with numbers from 1 - 10. If i want to set individual rules for each of them how do i do this? For example if i select 10 and in my total cell (which will be a different cell) hits 10 also, how do i automatically get excel to colour the row in red? in the same way, if that number is below 10 i want to colour it green. Basically, i want to write in, if this number is equal to or bigger than this number then colour red. Hope this makes sense, i new to excel!


thanks All
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
assuming the drop down is in A2 and the total cell is in B2

then a conditional formatting rule for each colour, it will work for all values between 1 and 10 - as its cell dependant and not values , so just a rule for each colour

select the row to colour

then
=$B$2 > = $A$2
format red

new rule
=$B$2 < $A$2
format green

Book5
ABCD
1dropdowntotal
21012
3
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D2Expression=$B$2<$A$2textNO
A2:D2Expression=$B$2>=$A$2textNO


for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
B2:D2 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=$B$2 > = $A$2

Format [Number, Font, Border, Fill]
choose the format you would like to apply when the condition is true
OK >> OK

Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top