简体   繁体   中英

Formatting row by row with conditional formatting in Excel

Let's say I have 2 columns that I'm comparing data in. If both cells match I want both cells to turn green. If they don't match I want them to turn yellow. Is there a formula that will allow me to check this for multiple records, or would this require looping in VBA? I can only seem to make this work 1 record at a time using conditional formatting. Thanks!

Edit: Adding results from provided answer

You can use conditional formatting, but you'll have to format each of the two columns separately.

Say your data is in A2:B100 (for simplicity)

Select the cells in columnA (A2:A100)
Select conditional Formatting >> New Rule >> Use a formula...
Enter the formula "=A3<>B3", choose a format and click OK

Repeat on column B.

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