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
1Member#FnameSurnameEmailMobile #Home Phone
22345BillBloogsbb@xxx.com04001234560312345678

<tbody>
</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
152345BillBloogs123 First StreetBlack StumpVIC3551312345678Homebb@xxx.com
162345BillBloogs123 First StreetBlack StumpVIC3551400123456Mobilebb@xx.com
173600KENNETHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVIC3555423234234Mobile
183601WAYNExxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxVIC3555434345345Mobile

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>

TIA
Bob
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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 :eek:)


Thanks Sandy
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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