Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

formula compare two colums

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Formula to compare two colums

Formula to compare two colums

ResolvedVersion 365

Formula to compare two colums

I need to ensure that a person only attends a location once.

Can you advise on a formula which can check two columns of data,one with a unique code and the other with the location - That would identity if any duplicate area have been assigned to a person.

Person Location
A58 Tyrone
A58 Fermanagh
A66 Fermanagh
A66 Fermanagh

Eg A58 is fine as they are at different locations
A66 is a false return as the two locations are the same.

There are about 900 people to be checked and over 1000 different locations, each person could have between 1 -5 locations.

Any help would be appreciated.
Thanks

RE: Formula to compare two colums

Hi Julie,

Thank you for the forum question.

You can use a COUNTIFS function.

Add a new column. If you have the unique code in the range A2:A200 and the location in the range B2:B200 and want the to find duplicates in column C the function should look like this:

=COUNTIFS($A$2:$A$200,A2,$B$2:$B$200,B2)

Copy the function down and if the function return 1 the record is unique otherwise it will display how many duplicates of the record you have.


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Excel tip:

Converting an American date format to European using Formula

Excel depending on your local setting will only pick up date values of the dd mmm yyyy oders as date type. If you import data from various sources including America their date order is different with data value in mmm dd yyyy, excel can only treat it as text indicated by left aligning it. To overcome this you have to do the the following.

1. Extract the date components mmm dd yyyy, by using the the Text functions LEFT, MID or RIGHT

2. Reorder dd mmm component and concatenate using "&" in the right order this will create a text string with the date in the right order it then needss to be converted to a value so excel can recognise it.

3. To convert to value encase in TEXT function.

4. Format to desired date format.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.