【问题标题】:Color coding (conditional formatting) the whole row based on value of a single column in google spreadsheet根据谷歌电子表格中单列的值对整行进行颜色编码(条件格式)
【发布时间】:2021-04-02 00:00:36
【问题描述】:

我在谷歌电子表格中有一些数据。 好像——

+----+--------------+---------+
|user|cos_similarity|item_rank|
+----+--------------+---------+
|  u1|   0.004437351|        1|
|  u1|  0.0043772724|        2|
|  u1|   0.004322561|        3|
|  u1|   0.004322561|        3|
|  u2|   0.004557799|        1|              
|  u2|   0.004471699|        1|               
|  u2|  0.0043906723|        1|              
|  u2|  0.0043018474|        2|         
|  u2|  0.0042955037|        3|         
+----+--------------+---------+

我想根据名为“item_rank”的列中的值对电子表格(所有行)进行颜色编码。

所以整行的颜色来自“item_rank”列中的值。颜色应该反映我通过特定列中的值定义的组。

预期输出-

Rows 1, 5, 6 should be having the same color because they have 'item_rank'=1.
Rows 2, 8 should be having the same color because they have 'item_rank'=2.
Rows 3, 4, 9 should be having the same color because they have 'item_rank'=3.

我如何做到这一点?

【问题讨论】:

标签: google-sheets formatting spreadsheet conditional-formatting


【解决方案1】:

对范围 A2:C 使用此公式变体:

=$C2=1

【讨论】:

  • 2在C2中的意义是什么?解决办法顺便说一句
  • @n0obcoder 那是起始位置/行。所以 C2 是范围 C2:C (或 A2:C 在你的情况下)的起始行
  • 如何为奇偶值编写自定义规则。假设我希望行仅以 2 种颜色着色。如果该行的 item_rank 为奇数,则为黄色,否则为绿色。我该怎么做? @player0
  • @n0obcoder 你能分享一份你的工作表副本吗?
  • 问题已解决。我使用自定义公式“=isodd(Value($C2))”为“item_rank”列中所有奇数值的行着色。
猜你喜欢
  • 2015-08-24
  • 2021-10-28
  • 2013-04-28
  • 1970-01-01
  • 1970-01-01
  • 2012-04-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多