How to sarch a text in a particular cell with the list of cells

naveentr

New Member
Joined
Aug 2, 2011
Messages
13
All,
Stuck in excel, which I am not finding solution. I need to search a text in a cell with a column and if matches, the value in which the adjacent cells should be copied to other cells.

I am attaching two sheets, which I have the data as, and the second one is the data I am in need of.. If the match is not found no changes should be made. Please let me know how can this be done. If this can be done with just a formula instead of VB, that will be helpful. Thanks a lot in advance for your help. Sorry for my poor english...

[TABLE="width: 727"]
<tbody>[TR]
[TD="colspan: 11"]Sheet1[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]City[/TD]
[TD]PIN[/TD]
[TD]Address[/TD]
[TD]Contact #[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]Address[/TD]
[TD]Contact #[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Bob[/TD]
[TD]ABC[/TD]
[TD]34758[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jim[/TD]
[TD]FHDKH[/TD]
[TD]60249[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jack[/TD]
[TD]EWIRY[/TD]
[TD]21324[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jack[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jack[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



[TABLE="width: 705"]
<tbody>[TR]
[TD="colspan: 11"]Sheet2[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]City[/TD]
[TD]PIN[/TD]
[TD]Address[/TD]
[TD]Contact #[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]Address[/TD]
[TD]Contact #[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD][/TD]
[TD][/TD]
[TD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D]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD][/TD]
[TD][/TD]
[TD]ABC[/TD]
[TD]34758[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD][/TD]
[TD][/TD]
[TD]ABC[/TD]
[TD]34758[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Please help me on this, this saves days of time. Thanks again.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Assuming the Name to search for is in column F:
In Sheet1 where the Address results should be (G2), enter:
Code:
=VLOOKUP($F2,Sheet2!$A$2:$E$13,4)
and where the Contact# results should be(H2), enter:
Code:
=VLOOKUP($F2,Sheet2!$A$2:$E$13,5)
ZAX
 
Upvote 0
Assuming the Name to search for is in column F:
In Sheet1 where the Address results should be (G2), enter:
Code:
=VLOOKUP($F2,Sheet2!$A$2:$E$13,4)
and where the Contact# results should be(H2), enter:
Code:
=VLOOKUP($F2,Sheet2!$A$2:$E$13,5)
ZAX

Hi Zak,

Could you explain that in bit detail please? and sheet1 and sheet2 are not just the exactly sheets, its just a name I have give for the initial and desired copy. All the data in the example stays in a single sheet, just are spread across different columns. To be specific image 1 is the data I have now and image 2 is the data in which format I am looking for. Please help!
 
Upvote 0
hi something like below Drag Donw D2 And E2 Formula below as you need if not then pls upload ur file any sharing site and paste link here


Excel Workbook
ABCDEFGHIJK
1NameCityPINAddressContact #***NameAddressContact #
2Jim**FHDKH60249***BobABC34758
3Jim**FHDKH60249***JimFHDKH60249
4Jim**FHDKH60249***JackEWIRY21324
5Jim**FHDKH60249******
6Jack**EWIRY21324******
7Jack**EWIRY21324******
8Jane**********
9Jane**********
10Jane**********
11Jane**********
12Bob**ABC34758******
13Bob**ABC34758******
Sheet1
 
Last edited:
Upvote 0
Thanks, Zax exactly the same I was looking for, only error is, when I drag or copy the formula, even the vlookup table_array is getting incremented. The table_array should always be the same.
 
Upvote 0
did you check my post #4 ?

Hi Kevatarvind, I did check the post #4.. all works fine except the table_array is getting incremented when I drag and drop the formula. Just making it without incrementing would fix the issue. Please help..
 
Last edited:
Upvote 0
Thanks, Zax exactly the same I was looking for, only error is, when I drag or copy the formula, even the vlookup table_array is getting incremented. The table_array should always be the same.

How is that??
I put an apsolute address (Using the $ sign) and shouldn't change at all!
hope you check it again...
And the formula on post #4 won't work if you're working on Excel 2003 then use this in the example in post #4...!
Code:
=IF(OR(ISTEXT(VLOOKUP($A2,$I:$K,2,0)),ISNUMBER(VLOOKUP($A2,$I:$K,2,0))),VLOOKUP($A2,$I:$K,2,0),"")
and..
Code:
=IF(OR(ISTEXT(VLOOKUP($A2,$I:$K,3,0)),ISNUMBER(VLOOKUP($A2,$I:$K,3,0))),VLOOKUP($A2,$I:$K,3,0),"")
ZAX
 
Last edited:
Upvote 0
Another way:

Code:
=IFERROR(INDEX($J$2:$K$4,MATCH($A2,$I$2:$I$4,0),MATCH(B$1,$J$1:$K$1,0)),"")


Markmzz
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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