Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pull out address field

Posted on 2013-05-21
4
Medium Priority
?
254 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 93

Accepted Solution

by:
Patrick Matthews earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

618 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