问题
I want to know what I would need to type into the formula box in excel to solve the problem outline below:
Key: *Variable/Cell*
IF *cellnumber* = 0 shade cells red
IF *cellnumber* > (more than) 0 but < (less than) *cell number* shade cells yellow
IF *cellnumber = *cellnumber* shade cells green.
回答1:
You want Conditional Formatting. Pre-Excel 2007 go to the Data menu and click conditional formatting. Excel 2007 or later go to the Home ribbon and click Conditional Formatting. Here is a guide to conditional formatting that shows something similar to what you need.
As for the second and third condition that apply to the value in another cell, you can put a reference in the conditional formatting window similar to "Cell Value : Equal to :" then =$A$1 in the value box.
For 2011: Any quotes below should NOT be typed. This assumes the cell you want to check against is A1.
- Select the range you want to be colored
- Home Ribbon -> Conditional Formatting -> Manage Rules
- New Rule
- "Format Only Cells That Contain"
- Choose: Cell Value & between
- Enter in "0" and "=$A$1" (remember, no quotes)
- Click Format -> Fill, choose yellow
- Click Ok
- New Rule
- "Format Only Cells That Contain"
- Choose Cell Value & Equal
- Enter in "0"
- Click Format -> Fill, choose red
- Click Ok
- New Rule
- "Format Only Cells That Contain"
- Choose Cell Value & Equal
- Enter in "=$A$1"
- Click Format -> Fill, choose green
- Click Ok
来源:https://stackoverflow.com/questions/7169299/how-to-compile-conditional-3-color-scale-excel-rule