Conditional formating if value is not found in range and a value present in Column A (is there a better way)

MRDBS

New Member
Joined
Nov 7, 2014
Messages
25
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi

I am using this condition, but it makes my workbook sluggish:

=AND($A1>1;$A1<>'Sheet2'!$B:$B)

I want to highlight cells which do only meet these criteria.
A1 has a value
But A1 not found in Sheet2 column B

let me hear it!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Maybe
can you select a range for B:B rather than the whole column
also
=AND($A1>1; countif( 'Sheet2'!$B1:$B1000, $A1 ) =0)

change the rows 1000 to however many rows you are likely to have in the sheet2
 
Upvote 0
Solution
Maybe
can you select a range for B:B rather than the whole column
also
=AND($A1>1; countif( 'Sheet2'!$B1:$B1000, $A1 ) =0)

change the rows 1000 to however many rows you are likely to have in the sheet2
Worked! Thanks
I also cleaned up some redundant conditions in the process.
 
Upvote 0
Maybe
can you select a range for B:B rather than the whole column
also
=AND($A1>1; countif( 'Sheet2'!$B1:$B1000, $A1 ) =0)

change the rows 1000 to however many rows you are likely to have in the sheet2
Just one question though I see you changed it to:

=AND($A1>1; countif( 'Sheet2'!$B1:$B1000, $A1 ) =0)

Is that more streamline than: $A1<>'Sheet2'!$B:$B)
 
Upvote 0
you are welcome,

I'm not sure , to be honest , and not sure that format works , hence why i choose countif()
BUT with B:B is address , in the latest version of excel , that is checking over a Million cells in an array , which it has to hold in memory
I'm sure other members with more detailed knowledge will be able to explain, or even offer better , faster, solutions
 
Upvote 0
I always use COUNTIF for things like this too. I would NEVER recommend using that Array solution, especially checking every single cell in column B. That is very inefficient and slow, as you have seen.

In any these formulas, the more you can limit the number of rows you check the better.
Just pick the smallest row number that you know you will never exceed.
 
Upvote 0
Ahh of course, makes sense now! I was confused since I tried countif, but did not get it to work because I was missing the =0 at the end.

Cool thing about excel is, you always learn something new.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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