excel - 条件格式行
问题描述
所以基本上我想在每次 A 列(初始编号)中的值更改时更改整行的颜色。理想情况下,我希望行的颜色介于深灰色和白色之间。
似乎没有适合此的特定明显的新条件格式规则。我尝试使用内置的唯一和重复条件格式规则,但这似乎没有帮助。我会继续尝试并在这里更新。
Initiative Number (A) Initiative (B)
I9532 Initiative I9532: Alberta: Platform Readiness
I8235 Initiative I8235: Rationalisation of Card Holder
I8638 Initiative I8638: EDW - MEA - MTF/ PROD/ DR
I8638 Initiative I8638: EDW - MEA - MTF/ PROD/
I7089 Initiative I7089: MIP Connectivity for Cloud Customer
I7089 Initiative I7089: MIP Connectivity for Cloud Customer
I7089 Initiative I7089: MIP Connectivity for Cloud Customer
I7089 Initiative I7089: MIP Connectivity for Cloud Customer
I7089 Initiative I7089: MIP Connectivity for Cloud Customer
I7089 Initiative I7089: MIP Connectivity for Cloud Customer
I1618 Initiative I1618: UTS - Standardization
I6018 Initiative I6018: EDW-MEA-BI-PTS Release and Stage
I2739 Initiative I2739: [DPS] Launch ECMS
I2739 Initiative I2739: [DPS] Launch ECMS
I2739 Initiative I2739: [DPS] Launch ECMS
解决方案
You can use a helper column and conditional formatting based on a formula to accomplish this.
- In the helper column (column C), add this formula starting in
C2
:=IF(A2<>A1,IF(C1=4,1,C1+1),C1)
. Change the instances of4
to however many colors you want to use. - This will then return
1, 2, 3, 3, 4, 4, 4...., 1, 2, 3, 3, 3
representing whether the Initiative Number has changed from the row above, and also what color the row should be - each number represents a different color. - Assuming you are working with 4 different colors, add 4 new conditional formatting rules based on the formulas
=$C2=1
,=$C2=2
,=$C2=3
, and=$C2=4
, where each rule applies a different fill color. - Continuing with the example, make sure that the "Applies to" Range is
$A$2:$B$16
.
You can hide the helper column if needed but included in the screenshot for reference.
推荐阅读
- wget - wget:抓取网页时保存URL
- python-3.x - 如何删除除括号和连字符(-)之外的所有特殊字符
- python-3.x - 在屏幕上放置一个 tkinter 标签几秒钟然后销毁它
- kubernetes - k8s/istio - 在 Envoy 不支持的情况下,服务之间的 HTTP 缓存的替代方案是什么?
- java - 错误:jdk-13.0.2 中不存在包 com.sun.javadoc
- java - 我怎样才能让这个代码打印一个数字中有多少个质数?
- android - 在 Kotlin 中使用协程 IO 线程时使用的主线程
- unit-testing - 如何在 It 块内使用嘲笑模拟代码
- php - laravel 获取 5 小时后的数据
- node.js - 将 Node.js 应用(托管在 GAE)的 IP 列入白名单以访问 MongoDB Atlas(托管在 GCP)