简体   繁体   中英

MS Excel 2007: Color cell collisions

I have a sheet with 2+C columns. The first two columns have pair of words.

What I need is that based on the information of the first two columns, the elements in the other columns should be highlighted if they exist as a pair.

How can this be done in MS Excel 2007 easily?

Image of Excel

I would use conditional formatting. I'm using Excel 2016 below but I'm fairly sure it is the same in Excel 2007.

First of all, create a helper column where you count up the number of times the words appear and then minus 2. If this evaluates to zero, both of your words have appeared. (In my example below, I have used column G).

Now click on (eg) cell C1 then go to Home - Conditional Formatting - New Rule. Click 'Use a formula to determine which cells to format' then enter

=and($G1=0,or(C1=$A1,C1=$B1))

(note my use of absolute references to tie the columns, but change the rows. See picture below.)

Excel条件格式

To copy to other cells, the easiest way is to use the 'format painter' button, or simply copy the cell and then overwrite the text. Be aware that when you copy the formatting, the references within the conditional format rule will update as you expect - so you may need to fiddle with the $ to get the result you want.

Edit

Regarding your comment below, I'm not sure what you mean. You mention in your question that the words you are looking for are in columns A and B. If you copy the conditional formatting across all cells, you will get highlights whenever the words appear.

I've thought about this a bit more and come up with a better formula for column G. Let me know if this helps.

在此处输入图片说明

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