Solved

How to compare 3 columns in excel?

Posted on 2016-11-08
7
46 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
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
Comment Utility
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 28

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
Comment Utility
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
Comment Utility
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 45

Expert Comment

by:Martin Liss
Comment Utility
Are you asking Expert Neeraj or me?
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now