问题
I have the below Excel-table:
| A | B
---------|-----------|---------------
1 | 500 |
2 | 500 |
3 | 500 |
---------|-----------|----------------
4 | 600 |
5 | 600 |
---------------------|----------------
6 | 300 |
---------------------|----------------
7 | 800 |
8 | 800 |
9 | 800 |
---------------------|----------------
10 | 200 |
11 | 200 |
---------------------|----------------
12 | 900 |
---------------------|----------------
13 | 100 |
14 | 100 |
In Column A
there a different numbers which can appear multiple times within the rows.
Now I am looking for a conditional formatting
that identifies if a number has switched compared to the previous row and if so all the other rows with the same number are coloured in yellow
until it switches again.
The result should look like this:
Do you have any idea what kind of conditional formatting
I need to achive this?
回答1:
- Select column A
- Insert new conditional formatting rule based on formula and use:
If one has Excel O365:
=ISEVEN(COUNT(UNIQUE(A$1:A1)))
Older versions of Excel could use:
=ISEVEN(SUMPRODUCT(1/COUNTIF(A$1:A1,A$1:A1)))
来源:https://stackoverflow.com/questions/63843095/colour-all-rows-with-the-same-colour-until-value-of-a-cell-is-not-the-same-as-in