Solved

Pull out address field

Posted on 2013-05-21
4
243 Views
Last Modified: 2013-05-21
I have a column of cells (B) with addresses in this format:

3636 Bravata Dr
Huntington Beach, CA 92649

Everytime the street is followed by a "Enter" before the city.

In column C I need to pull out just the street address (the top line). Any idea the formula for this?
0
Comment
Question by:cansevin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 19

Expert Comment

by:helpfinder
ID: 39184506
you can do it this way, but 2 steps are required.
In 1st step you will substitute Enter (new line) character to another and in 2nd step you will separate what was on the first line in original cell.
Assume you have your address in A1 cell, then in B1 use this formula =SUBSTITUTE(A1;CHAR(10);";")
In step 2, select B1, do Text to columns (divider will be ";" sign) and you will have what you need in C1 (the text following ";" will be in D1 and you can delete it if you do not need it

also you can see it in my sample
sample.xlsx
0
 
LVL 9

Expert Comment

by:WebDevEM
ID: 39184530
That will work, or you can do it in a single formula by using
=RIGHT(B1,LEN(B1)-FIND(CHAR(10),B1))

Open in new window

in Column C.  It looks for the position of Char(10) and takes everything to the right of it as the new value in Column C.

WebDevEM
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39184535
Or to do it in one step, use a formula like this:

=LEFT(B2,FIND(CHAR(10),B2&CHAR(10))-1)

Note that my formula will return the whole contents of B2 if there is no line break.

You could use just =LEFT(B2,FIND(CHAR(10),B2)-1) but that will return an error if there is no line break.
0
 

Author Closing Comment

by:cansevin
ID: 39184545
Thanks! Worked!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question