简体   繁体   中英

Comparing two columns of different worksheets and highlight common values in both columns

I have worksheets named WS1 and WS2. I need to compare Column C of WS1 with Column D of WS2. If both columns contain same values then I need to highlight both the cells of "Column C of WS1" and "Column D of WS2".

Example:

Column C of WS1     
500,000.00
260,000.00
65,000.00
30,000.00
46,104.00
530,000.00
350,000.00
55,000.00
7,000.00
2,520.16
30,000.00
210,000.00
650,000.00
10,000.00

Column D of WS2
2520.16
500,000.00
260,000.00
65,000.00
30,000.00
46,104.00
530,000.00
350,000.00
55,000.00
7,000.00
30,000.00
1,827,099.63
210,000.00
650,000.00
10,000.00

If values of Column C = Value of Column D then the cell containing same values in both columns is highlighted. My data is not uniform. They may have repetitive values. I am doing it manually right now and it is time-consuming as I have a lot of data to work on. Can you please suggest me.

Assuming your data starts in row 1 if each sheet, in WS1 column C set up a conditional format formula:

=IFERROR(MATCH(C1,'WS2'!$D:$D,0),FALSE)

In column D of WS2 this conditional format formula:

=IFERROR(MATCH(D1,'WS1'!$C:$C,0),FALSE)

The IFERROR wrapper is needed because an exact MATCH (last parameter = 0) will return a #N/A error if the value isn't found. Conditional format formulas must evaluate to TRUE (format applied) or FALSE (format not applied).

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