Solved

Pull out address field

Posted on 2013-05-21
4
193 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now