Compare value in one column with another

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Morning,
Working with numbers & having to make a large list.
Before i make a large mistake can you advise a basic code for me please.

The columns in question are W & X
The code will check the number value in the first cell in column W & make sure its the same as in the cell to the right.
The code will check all down my list.

Is the value matches then leave as is BUT if value does not match make cell in column X red


IF NO VALUE IN CELL COLUMN W THEN JUST MOVE ON

Thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
You can do this with conditional formatting. Highlight the cells in column X, then choose Conditional Formatting->New Rule->Use a formula...
The formula to apply is
Excel Formula:
=AND(X1<>W1,NOT(ISBLANK(W1)))
Change the row number to match the first row of your highlighted range. Set the format as you want it to appear.

Book1
WXY
111
223
333
4
544
656
72
869
977
10
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
X1:X9Expression=AND(X1<>W1,NOT(ISBLANK(W1)))textNO


Regards

Murray
 
Upvote 0
I dont understand the second part where you show X1:X9
 
Upvote 0
I now have it working but shows lots of errors where i can see the number is the same but im told its different.
 
Upvote 0
I dont understand the second part where you show X1:X9
That was just to show you an example of it working.
I now have it working but shows lots of errors where i can see the number is the same but im told its different.
Are you sure the numbers really are the same? As a test, I’m column Y where it is telling you they are different but they look the same (for example I will assume it is row 20) then in column Y put the formula
Excel Formula:
=W20=X20
If the two numbers are really the same it will show TRUE, if not it will show FALSE.
 
Upvote 0
Yes im sure,im looking at a different way now thanks as need to do it manually & leave quickly.

Thanks for reply
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,578
Members
449,174
Latest member
chandan4057

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