Setting up a loop to compare two columns

EURGAW

New Member
Joined
Mar 7, 2015
Messages
1
Hello, I realize this is a silly question but I'm very new at this so please be patient with me.

Let's say I have something like this (that I've parsed from a XML file, where the AnimalType returned 3 values in this order):

oLNXRP2.jpg



I'm trying to make it like this:
8XvKvDI.jpg


So the thing is, I want to compare the 2nd column with the first column, and if the first 3 letters are the same then it's a match! However, I have no idea how to compare these items and create an exit condition for when they no longer match. I've tried using a Do While loop but I end up creating an infinite loop that just spits out the first value.

Thanks for any help!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Would a formula solution like this work for you?

Excel Workbook
AB
1Animal TypeTag ID
2DogDog_1A
3DogDog_1B
4DogDog_1C
5CatCat_1A
6ParrotParrot_1A
7ParrotParrot_1B
Sheet1
 
Upvote 0

Forum statistics

Threads
1,216,071
Messages
6,128,623
Members
449,460
Latest member
jgharbawi

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