Reputation: 2478
I've a Excel file with three columns. Cells in each columns are different ranges for example column A has 797340 cells, column B has 91617 cells and column C has 95891 cells. I need to compare each value in column A and look if this value is on column B or it's in column C and if the condition is TRUE then bold the cell or change the color to red. If there any way to achieve this using Excel formulas? Any help?
Upvotes: 0
Views: 8426
Reputation: 12353
You can use conditional formating. Kindly refer to below image. Its just a demo.
Select Column A> Goto Conditional Formatting >> New Rules >> Use Formula to determine which cells to format
Enter the formula in >> Format values where formula is true >> select the format >> OK
=OR( IF(ISNA(VLOOKUP(A1,B:B,2,0)),FALSE,TRUE),IF(ISNA(VLOOKUP(A1,C:C,3,0)),FALSE,TRUE))
Upvotes: 2
Reputation: 330
Unless there is a reason you need to handle this with code, you can set conditional formatting within excel based on a formula.
For example, you can create a new conditional formatting rule based on a formula such as:
=IF(ISERROR(VLOOKUP([Cell in Column A],[Column B Range],1,FALSE)),"FALSE","TRUE")
This formula will return true when a matching value is found in column B. Then simply apply the same rule again for column C.
Apply this rule to the entire range of your column A cells, and set the conditional formatting to return bold and red when true.
Good luck!
Example with ranges in one worksheet: Formula as applied is
=IF(ISERROR(VLOOKUP($B3,$F:$F,1,FALSE)),"FALSE","TRUE")
Upvotes: 0
Reputation: 743
To make life easy use conditional formatting and apply your own custom rule.
Upvotes: 0