Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
HSL HSL is offline
external usenet poster
 
Posts: 3
Default Another Parsing address question

I was able to figure out how to parse out the house no. from an address but
am stuck on how to treat those addresses that are missing a house no.

For example,
if the address shows up as 123 Main Street, then the formula results in 123
- just as I want it.

however, if the address shows up as just "Main Street", then the formula
results in "Main". I just want it to result in null or blank.

Is there a way to get around this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Another Parsing address question

Assuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank

--
Biff
Microsoft Excel MVP


"HSL" wrote in message
...
I was able to figure out how to parse out the house no. from an address but
am stuck on how to treat those addresses that are missing a house no.

For example,
if the address shows up as 123 Main Street, then the formula results in
123
- just as I want it.

however, if the address shows up as just "Main Street", then the formula
results in "Main". I just want it to result in null or blank.

Is there a way to get around this?



  #3   Report Post  
Posted to microsoft.public.excel.misc
HSL HSL is offline
external usenet poster
 
Posts: 3
Default Another Parsing address question

Thanks!

"T. Valko" wrote:

Assuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank

--
Biff
Microsoft Excel MVP


"HSL" wrote in message
...
I was able to figure out how to parse out the house no. from an address but
am stuck on how to treat those addresses that are missing a house no.

For example,
if the address shows up as 123 Main Street, then the formula results in
123
- just as I want it.

however, if the address shows up as just "Main Street", then the formula
results in "Main". I just want it to result in null or blank.

Is there a way to get around this?




  #4   Report Post  
Posted to microsoft.public.excel.misc
HSL HSL is offline
external usenet poster
 
Posts: 3
Default Another Parsing address question

Great!

How would I get the street name by itself now?

"T. Valko" wrote:

Assuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank

--
Biff
Microsoft Excel MVP


"HSL" wrote in message
...
I was able to figure out how to parse out the house no. from an address but
am stuck on how to treat those addresses that are missing a house no.

For example,
if the address shows up as 123 Main Street, then the formula results in
123
- just as I want it.

however, if the address shows up as just "Main Street", then the formula
results in "Main". I just want it to result in null or blank.

Is there a way to get around this?




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Another Parsing address question

On Tue, 8 Jul 2008 00:20:42 -0400, "T. Valko" wrote:

ssuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank


1st Avenue returns a #VALUE! error.
--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Another Parsing address question

"Ron Rosenfeld" wrote in message
...
On Tue, 8 Jul 2008 00:20:42 -0400, "T. Valko"
wrote:

ssuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a
blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank


1st Avenue returns a #VALUE! error.
--ron


Yep. In that case we'll just have to return the street number as a text
value:

=IF(COUNT(--LEFT(A1)),LEFT(A1,FIND(" ",A1)-1),"")

--
Biff
Microsoft Excel MVP


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Another Parsing address question

On Tue, 8 Jul 2008 14:18:54 -0400, "T. Valko" wrote:

"Ron Rosenfeld" wrote in message
.. .
On Tue, 8 Jul 2008 00:20:42 -0400, "T. Valko"
wrote:

ssuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a
blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank


1st Avenue returns a #VALUE! error.
--ron


Yep. In that case we'll just have to return the street number as a text
value:

=IF(COUNT(--LEFT(A1)),LEFT(A1,FIND(" ",A1)-1),"")


I was not clear:

1st Avenue is the street without a number

473 1st Avenue might be a street address with a number.

I think you need to differentiate where the initial "word" is part of the
street name, or not.

Some examples where confusion might occur:

147 1st Avenue

2nd Avenue (No street address)

3A 4th Street

2 1/2 Middlesex Rd

4½ 92nd St.

--ron
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Another Parsing address question

"Ron Rosenfeld" wrote in message
...
On Tue, 8 Jul 2008 14:18:54 -0400, "T. Valko"
wrote:

"Ron Rosenfeld" wrote in message
. ..
On Tue, 8 Jul 2008 00:20:42 -0400, "T. Valko"
wrote:

ssuming that the cell entry is:

123 Main Street

You can test the first character to see if it's a number. If it's number
extract the number to the first space character. Otherwise, return a
blank:

=IF(COUNT(--LEFT(A1)),--LEFT(A1,FIND(" ",A1)-1),"")

123 Main Street returns numeric 123

Main Street returns a blank

1st Avenue returns a #VALUE! error.
--ron


Yep. In that case we'll just have to return the street number as a text
value:

=IF(COUNT(--LEFT(A1)),LEFT(A1,FIND(" ",A1)-1),"")


I was not clear:

1st Avenue is the street without a number

473 1st Avenue might be a street address with a number.

I think you need to differentiate where the initial "word" is part of the
street name, or not.

Some examples where confusion might occur:

147 1st Avenue

2nd Avenue (No street address)

3A 4th Street

2 1/2 Middlesex Rd

4½ 92nd St.

--ron


This is why I rarely respond to text parsing questions regarding names and
addresses!

--
Biff
Microsoft Excel MVP


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FOR RON ROSENFELD: PARSING QUESTION ORLANDO V[_2_] Excel Discussion (Misc queries) 4 April 15th 08 11:08 PM
parsing out an undelimited address and city [email protected] Excel Discussion (Misc queries) 1 February 2nd 07 05:54 PM
parsing out an undelimited address and city [email protected] Excel Discussion (Misc queries) 5 February 2nd 07 03:57 PM
Parsing address info Mike Excel Discussion (Misc queries) 2 December 1st 06 10:55 AM
Data parsing question Dan Neely Excel Worksheet Functions 0 July 19th 05 12:40 AM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"