Conditional Formatting Issue in Excel

In summary, to highlight values in column A that exist in column B, you can use the VLOOKUP function and conditional formatting. Set up two rules, one for when the VLOOKUP returns a value, and another for when it returns #N/A.
  • #1
s_j_sawyer
21
0
Hi everyone.

I have never worked in-depth with Excel and I am trying to make my life a bit simpler doing some data cleaning using the 'conditional formatting' option. My scenario is the following:

I have two columns of data, column A and column B. I would like to take each entry (a string of text) in column A and see if it exists anywhere in column B. If it does, I would like to highlight it one color, and if not I would like to highlight it another color. Actually, just highlighting one of the two cases would work.

I have figured out how to do this with one entry. I type

=OR(EXACT($A$2,$B$2:$B$35))

into the formula box under conditional formatting. This checks to see if the string in A2 exists anywhere in column B (i.e. from B2 to B35). If it does it will highlight it. However I cannot seem to generalize this to apply to every value in the column of A.

Any advice?
 
Technology news on Phys.org
  • #2
Thank you!</code>You can use a combination of the VLOOKUP function and conditional formatting to accomplish this. The VLOOKUP function will allow you to check if the value in column A exists in column B. If it does, it will return the value in column B, otherwise it will return a value of #N/A. You can then set up two conditional formatting rules, one for when the VLOOKUP returns a value, and another for when it returns #N/A. The first rule should be set up to highlight the value in column A (or both A and B if you want) when the VLOOKUP returns a value, and the second rule should be set up to highlight the value in column A (or both A and B if you want) when the VLOOKUP returns #N/A. The formula for the first rule should be:<code>=VLOOKUP($A2,$B$2:$B$35,1,FALSE)</code>The formula for the second rule should be:<code>=ISNA(VLOOKUP($A2,$B$2:$B$35,1,FALSE))</code>
 

Related to Conditional Formatting Issue in Excel

1. What is conditional formatting in Excel?

Conditional formatting in Excel is a feature that allows users to format cells or ranges of cells based on specific conditions. This can include formatting based on values, dates, or other criteria.

2. Why is my conditional formatting not working in Excel?

There can be several reasons why conditional formatting may not be working in Excel. Some common issues include incorrect cell references, conflicting formatting rules, and hidden cells or rows. It's important to check all of these factors and troubleshoot accordingly.

3. How do I add conditional formatting in Excel?

To add conditional formatting in Excel, select the cells or range of cells you want to format, then go to the "Home" tab and click on the "Conditional Formatting" button. From there, you can choose from a variety of formatting options or create your own custom rule.

4. Can I use conditional formatting in Excel to highlight specific cells?

Yes, conditional formatting can be used to highlight specific cells in Excel. You can choose from a variety of formatting options, such as changing the cell's color or font, to make the cells stand out.

5. How do I remove conditional formatting in Excel?

To remove conditional formatting in Excel, select the cells or range of cells with conditional formatting, then go to the "Home" tab and click on the "Conditional Formatting" button. Choose "Clear Rules" and then select "Clear Rules from Selected Cells" to remove the formatting.

Similar threads

  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
18
Views
5K
  • Other Physics Topics
2
Replies
42
Views
804
  • Computing and Technology
Replies
5
Views
1K
  • Differential Equations
Replies
3
Views
2K
  • Programming and Computer Science
Replies
9
Views
1K
Back
Top