简体   繁体   English

基于邻居单元启用Excel条件格式

[英]Enable Excel Conditional Formatting Based on Neighbouring Cell

For background, I operate a small side busines and use excel to record my activity. 对于背景,我操作一个小型商务并使用excel记录我的活动。 Every month, I set funding targets for different categories (eg paying employees, research and development, ordering samples, etc). 每个月,我都会为不同类别设定资金目标(例如,支付员工,研发,订购样品等)。 Broadly, theses categories either fall into the category of being goals (that is, I aim to meet the funding target) or limits (I am not to exceed the target). 从广义上讲,这些类别要么属于目标类别(即我的目标是达到资助目标),要么限制 (我不会超过目标)。 Currently, I use excel's 2-colour scale to get an easy graphical overview of how close I am to meeting my funding. 目前,我使用excel的双色刻度来轻松了解我与资金的接近程度。 I have a coloumn which shows percent funding for the month, and as I get closer to 100% funding for a given category the cell colour turns from a light green to light red. 我有一个coloumn,显示当月的资金百分比,随着我接近100%资助给定类别,细胞颜色从浅绿色变为浅红色。 This is extremely useful to me - I can see at a glance where I should allocate revenue once it comes in. 这对我来说非常有用 - 我可以一目了然地看到我应该在收入后分配收入。

What I want to achieve is setting an attribute for each category (either goal or limit) such that for a goal, the colour of the percent funding cell changes from red to green as I approach 100% funding and for limits, the colour of the percent funding cell changes from green to red as I approach 100% funding. 我想要实现的是为每个类别(目标或限制)设置一个属性,这样,对于一个目标,当我接近100%的资金和限制时,资金百分比的颜色从红色变为绿色。当我接近100%的资金时, 资金细胞的百分比从绿色变为红色。 I have no idea how to achieve this in excel - using the " use a formula to determine which cells to format " function allows me to make a distinction between goal and limit rows but then does not allow me to use the 2-color scale format. 我不知道如何在excel中实现这一点 - 使用“ 使用公式来确定要格式化的单元格 ”功能允许我区分目标和限制行但是不允许我使用2色标度格式。

Anyone have any insights into how this could be resolved? 任何人都有任何关于如何解决这个问题的见解?

You can achieve the same results by using multiple rules. 您可以使用多个规则获得相同的结果。

Say your cell is A2 and the value you are comparing is B2. 假设您的单元格为A2,您要比较的值为B2。 In cell A2 you can have rules like these: 在单元格A2中,您可以使用以下规则:

Rule 1: B2/C2 >= 0.9 Font Green 规则1:B2 / C2> = 0.9字体绿色

Rule 2: B2/C2 >= 0.5 Font Blue 规则2:B2 / C2> = 0.5字体蓝

Rule 3: B2/C2 >= 0.2 Font Red 规则3:B2 / C2> = 0.2字体红

For each rule except the last select the checkbox to stop further processing if true. 对于除最后一个规则之外的每个规则,选中该复选框以停止进一步处

Then you can copy the cells down to copy the rules relatively. 然后,您可以复制单元格以相对复制规则。 Make sure that the rules do not have absolute references like $B$2 which is the default. 确保规则没有绝对引用,如$ B $ 2,这是默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM