If/Match/then formula

Saoirse

New Member
Joined
Jan 27, 2022
Messages
33
Office Version
  1. 365
Platform
  1. Windows
I am trying to get a formula or macro to read if a cell in range of workbook 1 matches a cell in range in workbook 2, then highlight row in workbook 2.


So if Cell A:A in workbook 1 matches cell in D:D in workbook 2 then I want the cell (or row if possible) to highlight in workbook 2.

I've tried this =ISNUMBER(MATCH(B:B, 'wkbk1'!B:B, 0)) but it just highlighted the whole column. I've tried conditional formating options but it requires me to do it per cell and I need a range with over 10,000 rows. Any advice would be great. I'm thinking of creating a macro that also opens the second workbook but isn't necessary.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
With conditional formatting you set the rule to a cell and apply it to a range, you don't need to do it for each individual cell.
Assuming that you're starting from row 2, the formula to use would be

=ISNUMBER(MATCH($A2, 'wkbk1'!$D:$D, 0))

If the second workbook will be open then COUNTIF might be more efficient.

Regardless of which formula you use, it would be better to use realistic range sizes instead of full columns. If you only have 10000 rows of data then a full column wastes over 99% of the processing effort.

When you set up the rule it it's easiest to do it with the ranges based on the top left cell of the range to be formated.
Once you have that done you can change the 'Applies to' range to the rows and columns you want to format.
 
Upvote 0
Solution
Thank you! That helped, but now i got another one.

If i look at Worksheet 1 row 2 and I want to view cell in column A and cell in column C then if those both match ANY rows in worksheet 2 I want them to highlight in worksheet 1. Would I just do an isnumber match formula for conditional formatting?

So if I do an =ISNUMBER(MATCH(B1, 'Sheet 1'!A:A,0)) that won't look at both columns. Can I adjust to have it look at two columns and compare to two columns in worksheet 2?

So row 9 on worksheet 1 matches row 5 on worksheet 2. how would I get worksheet 1 to highlight the row since both numbers match?

worksheet 1


amountidentification
10​
3456​
20​
432​
34​
8756​
35​
6532​
37​
9876​
46​
412​
58​
865​
59​
5432​
65​
9865​
35​
4321​
17​
5432​
94​
764​
880​
98723​
56​
654​
worksheet 2


amountidentification
58​
865​
5​
87​
67​
639​
764​
1469​
65​
9865​
78​
3468​
45​
9876​
23​
3457​
45​
87654​
65​
2346​
89​
5423​
98​
88754​
543​
6532​
23​
5432​
 
Upvote 0

Forum statistics

Threads
1,215,513
Messages
6,125,258
Members
449,219
Latest member
daynle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top