Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2015, 05:54 PM
MMT MMT is offline Extracting data from a cell with multiple lines of text Windows XP Extracting data from a cell with multiple lines of text Office 2010 64bit
Novice
Extracting data from a cell with multiple lines of text
 
Join Date: Feb 2015
Posts: 3
MMT is on a distinguished road
Default Extracting data from a cell with multiple lines of text

I'm hoping to find someone willing to help with this problem:

I have an Excel file with several thousand records that are in the following format (this represents the contents of a single cell):

System Acct: 123456 Name: 10 FRIENDS OF MONKEYS Credit Limit: 5.00
BusSys Acct: 123456 Address1: 534 SW WEST AVENUE STE 3 Balance: 5.00
Rate Code: P01L Address2: Aging Bucket: 0
City: YORKTOWN Cus Grp: PT Personal Transient
ST/Zip: OR, 97777 Assigned Sales: 999 Unassigned Salesperson
Phone: 530-947-1000 Tear#: 0 Proof#: 0 Aff#: 0
Notes:

What I need to accomplish is to extract the "Name", "Address1", "City", "ST/Zip" and "Phone" into another unique cell or set of cells.

I spent some time poking around the web and found a way, using "FIND" and "MID", to extract each one separately but I don't know how to combine all of the functions and have the results end up in a separate single cell (we want to create a "call list" or mailing list from the results). Here's what I used to get the "Address1" value:

=MID(A11,FIND("Address1:",A11)+10,FIND("Balance:", A11,FIND("Address1:",A11)+1)-46-FIND(" ",A11))

Anyone go ta slick way to accomplish the above? Many thanks for anyone willing to lend a mind
Reply With Quote
  #2  
Old 02-11-2015, 10:42 PM
macropod's Avatar
macropod macropod is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

To do this properly, you should output each of Name, Address1, Address2, City, ST/Zip & Phone to separate columns. That way the data can be used for label/list generation via a Word mailmerge. Ideally, you'd do the text-to-columns processing for these data with a macro for all data fields. For the fields you're interested in, though, you can do it with formulae, thus:
Name =MID(A1,SEARCH("Name:",A1)+6,SEARCH("Credit Limit:",A1)-SEARCH("name:",A1)-6)
Address1 =MID(A1,SEARCH("Address1:",A1)+10,SEARCH("Balance: ",A1)-SEARCH("Address1:",A1)-10)
Address2 =MID(A1,SEARCH("Address2:",A1)+10,SEARCH("Aging Bucket:",A1)-SEARCH("Address2:",A1)-10)
City =MID(A1,SEARCH("City:",A1)+6,SEARCH("Cus Grp:",A1)-SEARCH("City:",A1)-6)
ST/Zip =MID(A1,SEARCH("ST/Zip:",A1)+8,SEARCH("Assigned Sales:",A1)-SEARCH("ST/Zip:",A1)-8)
Phone =MID(A1,SEARCH("Phone:",A1)+7,SEARCH("Tear#:",A1)-SEARCH("Phone:",A1)-7)
where the cell to be processed is A1.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-11-2015, 11:16 PM
excelledsoftware excelledsoftware is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Ok this is possible to do with formulas but it will require a lot of them in different columns and it just sounds like a pain. You mentioned you were looking for a slick way to accomplish the above. I cant think of anything slicker than pushing a button and having it all magically happen.

That is what the attached workbook does. I wrote some VBA code to parse out the information and then I have a very simple concatenating formula putting together the name address and phone number. This will work with any number of records and you can even add columns if you need to.

I tested it with the data you provided and it appears to work well. If there are any issues let me know and I will sort them out.

You will have to excuse the old workbook format I have my reasons for using an older version lol.

Thanks for the opportunity to provide solutions.
Attached Files
File Type: xls Address Parse.xls (32.5 KB, 17 views)
Reply With Quote
  #4  
Old 02-11-2015, 11:17 PM
excelledsoftware excelledsoftware is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

My apologies macropod I posted right after you because I did not refresh my page and didnt see any replies. I did not mean to highjack your solution.
Reply With Quote
  #5  
Old 02-11-2015, 11:25 PM
macropod's Avatar
macropod macropod is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

No offence taken. As you'll see from my post, I too believe a macro solution (that extracts all the data) would be preferable. I also believe the data should be exported to different columns for each element.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 02-11-2015, 11:37 PM
excelledsoftware excelledsoftware is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Great! Thanks so much!
Reply With Quote
  #7  
Old 02-12-2015, 10:17 AM
MMT MMT is offline Extracting data from a cell with multiple lines of text Windows XP Extracting data from a cell with multiple lines of text Office 2010 64bit
Novice
Extracting data from a cell with multiple lines of text
 
Join Date: Feb 2015
Posts: 3
MMT is on a distinguished road
Default

WOW! What a nice surprise to find this early in the morning! Thank you both!

Excelled Software, I opened your file and ran the script... then realized I'd made a major blunder. The data is not in a single cell as I had described. I think in the process of playing with the data I placed it in a single cell and did not refer back to the original file when I posted my question. I'm so sorry. The data is actually in separate rows. Needless to say I'm embarrassed for having you spend the time on this. Sorry.

I'm going to see if I can decipher what you provided to get it to work.

I appreciate your time and willingness to help, both of you!
Reply With Quote
  #8  
Old 02-12-2015, 10:37 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Always better to post a real sheet ( click "Go advanced" and " manage attachments"). Everybody gains
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #9  
Old 02-12-2015, 03:16 PM
MMT MMT is offline Extracting data from a cell with multiple lines of text Windows XP Extracting data from a cell with multiple lines of text Office 2010 64bit
Novice
Extracting data from a cell with multiple lines of text
 
Join Date: Feb 2015
Posts: 3
MMT is on a distinguished road
Default

I'll remember that, thanks. I did get this to work and I really do appreciate the help in getting in done.
Reply With Quote
  #10  
Old 02-12-2015, 09:18 PM
excelledsoftware excelledsoftware is offline Extracting data from a cell with multiple lines of text Windows 7 64bit Extracting data from a cell with multiple lines of text Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Fantastic to hear. I'm glad it worked out.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting data from a cell with multiple lines of text Excel 2013 – need help extracting date and time from text cell plus more. Art Mann Excel 1 07-18-2014 09:55 PM
userform to enter multiple lines of data in template callasabra Word VBA 0 06-27-2014 05:29 PM
Extracting data from a cell with multiple lines of text Multiple lines of placeholder text hanilucida PowerPoint 1 06-21-2014 05:40 AM
Multiple data in one cell? New Daddy Excel 4 09-06-2013 02:50 AM
Extracting data from a cell with multiple lines of text extracting data from Table to text file Anirudh_Dsp Word Tables 1 05-23-2010 07:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft