How can I search inside a range by using the Conditional Formatting to search a value by using the cell's letter and number instead of a value?

arthurz11

Board Regular
Joined
Nov 9, 2007
Messages
169
Office Version
  1. 2021
Platform
  1. Windows
For example: Range is A1:B2.
Cell A1 is 1
Cell A2 is 2
Cell B1 is 3
Cell B2 is 4

Cell A5 is 1

After highlighting range A1:B2. Select Conditional Formatting and use the formula =SEARCH( A5,1,0)) and format the color cell A1 yellow? That way it will search any cell within the range that contains the value 1 and highlighted yellow. Even if more than one cell contains the value of one.
I did not use the IF statement because the value of Cell A5 will always change
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
What exactly are you trying to do?
Are you trying to search the range A1:B2, and highlight the cell that is equal to the value in cell A5?
If so, just use this Conditional Formatting formula:
Excel Formula:
=$A$5
 
Upvote 0
What exactly are you trying to do?
Are you trying to search the range A1:B2, and highlight the cell that is equal to the value in cell A5?
If so, just use this Conditional Formatting formula:
Excel Formula:
=$A$5
I have done that but to no success. It highlights all the cell's within that range. It should highlight just cell A1. Even if I select any number in cell A5, it still highlights all the cell's in that range.
 
Upvote 0
I have done that but to no success. It highlights all the cell's within that range. It should highlight just cell A1. Even if I select any number in cell A5, it still highlights all the cell's in that range.
Whoops, the formula should look like this:
VBA Code:
=A1=$A$5
The "A1" represents the very first cell in the range you have selected to apply the Conditional Formatting to.
Excel is smart enough to adjust it for the other cells in the range.
 
Upvote 0
Solution
What exactly are you trying to do?
Are you trying to search the range A1:B2, and highlight the cell that is equal to the value in cell A5?
If so, just use this Conditional Formatting formula:
Excel Formula:
=$A$5
When I use it without the $ signs in the Conditional Formula, it does highlight cell A1. But when I change B2 to a 1. It doesn't highlight it.
 
Upvote 0
Did you change the formula to what I showed in my last post?
And you ABSOLUTELY need to keep those dollar signs in the formula in order for it to work correctly.

Examples of it working:

1725645653967.png


1725645635049.png
 
Upvote 0
Did you change the formula to what I showed in my last post?
And you ABSOLUTELY need to keep those dollar signs in the formula in order for it to work correctly.

Examples of it working:

View attachment 116520

View attachment 116519

Did you change the formula to what I showed in my last post?
And you ABSOLUTELY need to keep those dollar signs in the formula in order for it to work correctly.

Examples of it working:

View attachment 116520

View attachment 116519
Now that it works, will I be able to search from range to range? For instance, in the Conditional Formula write = A1= $A$5:$B$6,$A$1:$B:$2. Or do I have to put another post if this formula does not work? I am going to try it now.
 
Upvote 0
Now that it works, will I be able to search from range to range? For instance, in the Conditional Formula write = A1= $A$5:$B$6,$A$1:$B:$2. Or do I have to put another post if this formula does not work? I am going to try it now.
Nope, it didn't work
 
Upvote 0
Excel Formula:
 = A1= $A$5:$B$6,$A$1:$B:$2
That is not a valid formula. I literally have no idea what you are trying to do here.

Can you show us an actual example of exactly what you are trying to do (show us your data and your expected result)?
 
Upvote 0
OK, I missed that my answer did solve your first question, and now you are actually asking a new, different question.
 
Upvote 0

Forum statistics

Threads
1,224,808
Messages
6,181,072
Members
453,020
Latest member
mattg2448

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