Referencing another Sheet for Conditional Format

PlumGr8

Board Regular
Joined
Nov 23, 2017
Messages
145
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
So i have cell range on another sheet, say D5 to F25 with data. Simple list on Serial Number (SN1001, SN1002, etc). Is there a way to reference these values from another sheet with conditional formatting to turn a cell yellow is there's a match? Like if Sheet 1 Cell D5 says "SN1001" and Sheet 2 has "SN1001" in the listed range it turns yellow. I know i can do it cell to cell, but i need to reference about 75 SN's and i keep getting a reference error. Any help would be great, thanks.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Use a formula to create conditional formatting rule. The formula to be used is:
Excel Formula:
=COUNTIF(Sheet2!$D$5:$F$25;A2)>0
where:
Sheet2!$D$5:$F$25 is absolute (note dollars signs) range with SNs to be checked together with a sheetname (if sheet name contains sopace use apostrophes around it) [1 on screenshot]
A2 is a current cell relative (note no $s) address where content is to be checked and "painted" if found in reference range [2 on screenshot]
 

Attachments

  • Zrzut ekranu 2024-07-15 102855.png
    Zrzut ekranu 2024-07-15 102855.png
    87.6 KB · Views: 8
Upvote 0
Use a formula to create conditional formatting rule. The formula to be used is:
Excel Formula:
=COUNTIF(Sheet2!$D$5:$F$25;A2)>0
where:
Sheet2!$D$5:$F$25 is absolute (note dollars signs) range with SNs to be checked together with a sheetname (if sheet name contains sopace use apostrophes around it) [1 on screenshot]
A2 is a current cell relative (note no $s) address where content is to be checked and "painted" if found in reference range [2 on screenshot]
So here is what i have

=COUNTIF(Engine SN!$B$3:$K$35;D6)>0

But, i keep getting the syntax error. I've even tried changing the sheet name to Sheet2 but still get the error. Would it matter if Cell D6 is a merged block of a few cells? That cell is a merged cell of D6 - D10.
 
Upvote 0
If you have a space in your sheet name, you need to enclose the sheet name in single quotes, i.e.
Excel Formula:
=COUNTIF('Engine SN'!$B$3:$K$35;D6)>0
 
Upvote 0
If you have a space in your sheet name, you need to enclose the sheet name in single quotes, i.e.
Excel Formula:
=COUNTIF('Engine SN'!$B$3:$K$35;D6)>0

Hmm, i did try that, but still have that "There's a problem with this formula" warning.
 
Upvote 0
Where are you located?
What is used as the separator for your formula arguments? Is it a comma or semi-colon? It can differ based on your regional settings.

You are currently showing a semi-colon, but perhaps it should be a comma, i.e.
Excel Formula:
=COUNTIF('Engine SN'!$B$3:$K$35,D6)>0
 
Upvote 0
Solution
Semicolon is probably copied from my formula. :-)
Sorry for that.
I expected you will replace it with your formula separator.
I usually change it manually to coma in my posts, but somehow I did not do that in post #2.
 
Upvote 0
Conditional formatting doesn't work with references to other sheets in some versions of Excel. What version are you using?
 
Upvote 0
Where are you located?
What is used as the separator for your formula arguments? Is it a comma or semi-colon? It can differ based on your regional settings.

You are currently showing a semi-colon, but perhaps it should be a comma, i.e.
Excel Formula:
=COUNTIF('Engine SN'!$B$3:$K$35,D6)>0
That seemed to be it. I am in the US, i honestly didn't even know that ; and , made a difference like that between regions. But that seems to have worked, i got it to highlight for me. Appreciate the help very much.
 
Upvote 0
Conditional formatting doesn't work with references to other sheets in some versions of Excel. What version are you using?

Office 2019. I guess it was the difference between using ; and , I honestly had no idea that changed between regions.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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