Tricky problem using vlookup.

Barcode

Board Regular
Joined
Sep 8, 2009
Messages
75
I have membership data stored in a sheet and I need to extract data for some members to a second sheet.

Using vlookup I can extract the data without any problems. BUT, some members have 2 rows of data where the data is identical except the first row has a mobile phone number in column 8 and the second row has a home phone number in column 8.

How can I extract the home phone number from the second row and have it placed on the same row in the second sheet that I am extracting data to?

The second sheet will look like this:
Excel 2016 (Windows) 64 bit
ABCDEF

<tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]Member#[/TD]
[TD="align: center"]Fname[/TD]
[TD="align: center"]Surname[/TD]
[TD="align: center"]Email[/TD]
[TD="align: center"]Mobile #[/TD]
[TD="align: center"]Home Phone[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]2345[/TD]
[TD="align: center"]Bill[/TD]
[TD="align: center"]Bloogs[/TD]
[TD="align: center"]bb@xxx.com[/TD]
[TD="align: center"]0400123456[/TD]
[TD="align: center"]0312345678[/TD]

</tbody>

A modded part of the Membership sheet showing a member with 2 rows of data (Home and Mobile phone):
Excel 2016 (Windows) 64 bit
BCDEFGHIJKL
BillBloogs123 First StreetBlack StumpVIC312345678Homebb@xxx.com
BillBloogs123 First StreetBlack StumpVIC400123456Mobilebb@xx.com
KENNETHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVIC423234234Mobile
WAYNExxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVIC434345345Mobile

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]15[/TD]
[TD="align: right"]2345[/TD]

[TD="align: right"][/TD]

[TD="align: right"]3551[/TD]

[TD="align: center"]16[/TD]
[TD="align: right"]2345[/TD]

[TD="align: right"][/TD]

[TD="align: right"]3551[/TD]

[TD="align: center"]17[/TD]
[TD="align: right"]3600[/TD]

[TD="align: right"]3555[/TD]

[TD="align: right"][/TD]

[TD="align: center"]18[/TD]
[TD="align: right"]3601[/TD]

[TD="align: right"]3555[/TD]

[TD="align: right"][/TD]

</tbody>

TIA
Bob
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
try PowerQuery (Get&Transform)
- remove unnecessary columns
- Pivot PhoneType column by PhoneNumber column with Don't Aggregate option
 
Upvote 0
You could use a lookup formula like this:

=LOOKUP(2,1/(B15:B18=A2)/(K15:K18="Home"),J15:J18)

and just change Home to Mobile as needed.
 
Upvote 0
one way


Excel 2013/2016
ABCDEFGHIJK
12345BillBloogs123 First StreetBlack StumpVIC3551312345678Homebb@xxx.com
22345BillBloogs123 First StreetBlack StumpVIC3551400123456Mobilebb@xx.com
33600KENNETHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVIC3555423234234Mobile
43601WAYNExxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVIC3555434345345Mobile
Sheet2



Excel 2013/2016
ABCDEF
1Member#FnameSurnameEmailMobile #Home Phone
22345BillBloogsbb@xxx.com400123456312345678
Sheet1
Cell Formulas
RangeFormula
E2{=INDEX(Sheet2!$I:$I,MATCH(Sheet1!$A2&TRIM(LEFT(SUBSTITUTE(E$1," ",REPT(" ",500)),500)),Sheet2!$A:$A&Sheet2!$J:$J,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks for the replies sandy, Rory and Alan. much appreciated.

There's a lot I don't understand there but I'll play around with it and see how I go.
 
Upvote 0
I've tried for a few hours to implement the 3 options above but to no avail. I can use vlookup with no problems but I just cannot understand the options above.


Is it ok for one of you to show me how it's done? If so I will attach a desensitized copy of the members file.


TIA
Bob
 
Upvote 0
Actually cancel that above request. I'd like to know how to do it for future use but it is not needed now. It took less than an hour to do the job manually. I expected it to take much longer.

Thank you fellas for your help, it was very much appreciated. I've been coming here for years seeking help and I've always got a result. It definitely is a gold mine for Excel users.
 
Upvote 0
I had a look at it but it was too much to understand in 1 viewing. I'll have to throw it up on the large screen and use the pause button (a lot :eeek:)


Thanks Sandy
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,029
Members
452,542
Latest member
Bricklin

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