Solved

How to compare 3 columns in excel?

Posted on 2016-11-08
7
86 Views
Last Modified: 2016-11-09
I want to compare the field in 3 columns in excel.
I need to check if they have the same content.
For instance if in field A24, C24, E24, I want to check if it has the same content.
If not, I need to be alerted.
Can this be done?
Thanks,
0
Comment
Question by:100questions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 47

Expert Comment

by:Martin Liss
ID: 41879391
If Range("A24") = Range("C24") And Range("A24") = Range("E24") Then
    'Do nothing
Else
    Msgbox "Not the same"
End If

Open in new window

0
 

Author Comment

by:100questions
ID: 41879402
Thanks.
Do I simply add this in an Excel field, to the right of the data?
I need to do this fo many fields, approximately 600 rows of fields.
0
 
LVL 30

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41879411
Why not apply conditional formatting to identify if A24, C24 and E24 have the same content?
To do so, select the cell A24 and make a New Rule for conditional formatting using the formula given below and format as per your choice. And then select the A24, copy the formatting using the Format Painter and paste into C24 and E24.
So if all the three cells contain the same content, these three cells would be highlighted with the color you chose during formatting.
In the attached, I have applied the conditional formatting for your reference.
=AND($A24&$C24&$E24<>"",$A24=$C24,$C24=$E24)

Open in new window

Conditional-Formatting.xlsx
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41879413
In the attached, the conditional formatting is applied to the range A1:A600, C1:C600 and E1:E600. The borders are there just for reference, you may remove them.
Conditional-Formatting.xlsx
0
 

Author Comment

by:100questions
ID: 41879451
Thanks.
How do I change the sheet so that it refers to columns/fields, D12, I12, N12 instead, and for 700 rows down?
Thanks again.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 41879503
Are you asking Expert Neeraj or me?
0
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41879756
Select the range D12:D700 and make a new rule for conditional formatting using the formula given below...
=AND($D12&$I12&$N12<>"",$D12=$I12,$I12=$N12)

Open in new window

Same formula will be used for I12:I700 and N12:N700.

In the attached, the conditional formatting is applied to the above mentioned ranges.
Conditional-Formatting.xlsx
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question