Compare text within entire rand of column and return desired value

Imran0709

New member
Joined
Aug 2, 2019
Messages
1
Reaction score
0
Points
0
Excel Version(s)
2013
Compare text within entire range of column and return desired value

So here’s my problem.

Column A contains list of cities say

A1 has pune
A2 has mumbai
A3 delhi
A4 delhi chandigarh

Now,

1. I want to say find “delhi” anywhere through A1 to A4.
2. Whichever row number it finds it in, it’s corresponding row of the next column should return “del”

Eg. Here it will find “delhi” in A3 so in B3 it should return “del”

This could be achieved with if(isnumber(search))) function. However, my problem statement is a little complex.

3. Along with finding “delhi” I also want to find “delhi chandigarh” and return “dch” in the corresponding row of the next column wherever it finds “delhi chandigarh”

Problem: Since it take up the the 1st occurrence. Here, once it finds “delhi” in A3 and writes “del” in B3 and moves to A4 it again checks for “delhi” first and finds it in A4 as well and writes “del” in B4. The next condition of checking “delhi chandigarh” doesn't happen only and in both B3 as well as B4 it shows up as “del”.

Ideally, I would want

A3 “delhi” so B3 “del” and A4 “delhi chandigarh” so b4 “dch”

Please help at the earliest.
 
Last edited:
Please post a sample sheet.

Also take into account that this a a free forum where members help your for FREE on their spare time.
You cannot expect them to be waiting in front of their keyboard for members looking for urgent answers.
You can always contact pay sites for urgent matters
Cheers
 
Back
Top