Match? Index? Lookup? Which to use?

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
I have data I get from Outlook I want to enter into Excel.
I copy all client data to a blank sheet. I then want to look for the word Mobile: and have it list the data to the right of the colon. For example:

Lewis, Randy
123 Roadway Drive
Yourville, SC 98765
Bus: (212) 299-8888
Mobile: (212) 222-4444
Bus Fax: (212) 333-5555

Basically I want it to find Bus: then give me the data in a cell &
Mobile: Give me the data
Bus Fax: Give me the data

I have been trying Match, but with no success. I know I can't us lookup becasue it has to be sorted. Any ideas?

Thank You,
Michael
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Are the data rows always in the same format?
i.e.
Name
Addr1
Addr2
Busphonenumber
mobilephonenumber
faxnumber

Also, if someone does not have one of these, does it still have a blank?

i.e.
Bus: (212) 299-8888
Mobile:
Bus Fax: (212) 333-5555

Thanks,
Colbymack
 
Upvote 0
Yes, the data shows in the same order each time.
No, nat all data shows everytime. ie: cell number may be there or may not.

That is why I know I have to use MID or MATCH or something to lookup the data. It will always have the word say for example Mobile.

Michael
 
Upvote 0
I'd just highlight the three cells in question and quickly hit Data | Text to Columns... -> Delimited -> Other=colon -> text + text -> Finish and bang, you're done.
 
Upvote 0
Well that is fine, but I have to have the data in a certain cell in the spreadsheet I am entering it into.

So I need it to copy the mobile number and put it into cell A6 for example.

So I need to separate each one using some sort of lookup formula??

Thank You,
Michael
 
Upvote 0
Ah... a bit more light on the subject... :wink:

Like so perhaps?
book1
ABCD
1Lewis, Randy
2Mobile: (212) 222-4444<== helper cell123 Roadway Drive
3(212) 222-4444<== using helper cellYourville, SC 98765
4Bus: (212) 299-8888
5(212) 222-4444<== without help cellMobile: (212) 222-4444
6Bus Fax: (212) 333-5555
Sheet1


Formulae:<ul>[*]A2 =INDEX($C$1:$C$6,MATCH("mobile*",$C$1:$C$6,0))[*]A3 =RIGHT(A2,LEN(A2)-FIND(":",A2,1))[*]A5 =RIGHT(INDEX($C$1:$C$6,MATCH("mobile*",$C$1:$C$6,0)),LEN(INDEX($C$1:$C$6,MATCH("mobile*",$C$1:$C$6,0)))-FIND(":",INDEX($C$1:$C$6,MATCH("mobile*",$C$1:$C$6,0)),1))[/list]
 
Upvote 0
Greg... Thank You.
That is amazing.
It would have taken me a year to come close to this answer.

One thing, Is there a way to have it not show #N/A when say the Mobile: number never shows up??

Thank You,
Michael
 
Upvote 0
Much easier if we use just a wee bit of VBA to help us out. Add in a UDF called v(). The code for v() is here. Then edit the formula to be:<ul>[*]=IF(ISNA(v(INDEX($C$1:$C$6,MATCH("mobile*",$C$1:$C$6,0)))),"no cell phone",RIGHT(v(),LEN(v())-FIND(":",v(),1)))[/list]<hr>If you have never added a UDF...

To add a User Defined Function (UDF) to a workbook:
  1. Alt+F11 to get to the Visual Basic Editor (VBE).
  2. If WB does not contain any Standard Modules then from the VBE menu Insert|Module
  3. Add in code (copy and paste).
  4. Alt+F11 to jump back to Excel.
  5. In the cell enter the formula using the newly created UDF. Example<ul type=square>
  6. =myNewUDF()
[/list]
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,729
Members
449,049
Latest member
MiguekHeka

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