简体   繁体   中英

How to format groups of rows based on number sequence in Excel

I have a list of data that I would like to format.

This list of data contains multiple rows and these rows belong to their own group of rows.

Example below:

ID|Text|SeqNo
1 |xaas|4     ~
1 |fgda|3     ~
1 |gxda|2     ~
1 |axss|1     ~
1 |sdda|2
1 |xxda|1
2 |sbeq|4     ~
2 |ssdd|3     ~
2 |dfs1|2     ~
2 |asd1|1     ~
2 |aaff|3
2 |ggff|2
2 |gdad|1
2 |ssss|2     ~
2 |srfa|1     ~

I want to change the formatting (fill colour) of the group of rows that belong to the sequence under SeqNo . They do not need to be uniquely coloured, this is for readability purposes so that it is easy to see what rows belong to what group.

I have added ~ characters next to each group (think of zebra style).

All of the rows that are grouped together with the ~ I would want formatted the same way and the rows without the ~ would be formatted the same way.

For the time being relying on the tildes :)

Clear any existing CF from A:C and select A:C (assuming those are your columns) and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: :

=$D1="~"  

Format... , select choice of formatting, OK , OK .

You can either leave the "others" unformatted or apply 'standard' formatting to the entire column or columns (CF has precedence).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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