Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Retrieve first 3 words in a cell

I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Retrieve first 3 words in a cell

This formula should work, provided there is always at least four words in the
cell:

=LEFT(A2,FIND(" ",A2,FIND(" ",A2,FIND(" ",A2)+1)+1)-1)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"KrispyData" wrote:

I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Retrieve first 3 words in a cell

in
B1 1245 main street suite 10
in
A1 =LEFT(B1,FIND(" ",B1,1+FIND(" ",B1,1+FIND(" ",B1,1))))

KrispyData wrote:
I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Retrieve first 3 words in a cell

There are at least 3 words in each cell?

"Luke M" wrote:

This formula should work, provided there is always at least four words in the
cell:

=LEFT(A2,FIND(" ",A2,FIND(" ",A2,FIND(" ",A2)+1)+1)-1)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"KrispyData" wrote:

I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Retrieve first 3 words in a cell

Try the below formula

=LEFT(SUBSTITUTE(A1 & " "," ",REPT(" ",255),3),255)

If this post helps click Yes
---------------
Jacob Skaria


"KrispyData" wrote:

There are at least 3 words in each cell?

"Luke M" wrote:

This formula should work, provided there is always at least four words in the
cell:

=LEFT(A2,FIND(" ",A2,FIND(" ",A2,FIND(" ",A2)+1)+1)-1)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"KrispyData" wrote:

I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Retrieve first 3 words in a cell

Perfect!
Thank you, Jacob!

"Jacob Skaria" wrote:

Try the below formula

=LEFT(SUBSTITUTE(A1 & " "," ",REPT(" ",255),3),255)

If this post helps click Yes
---------------
Jacob Skaria


"KrispyData" wrote:

There are at least 3 words in each cell?

"Luke M" wrote:

This formula should work, provided there is always at least four words in the
cell:

=LEFT(A2,FIND(" ",A2,FIND(" ",A2,FIND(" ",A2)+1)+1)-1)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"KrispyData" wrote:

I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Retrieve first 3 words in a cell

On Tue, 27 Oct 2009 09:46:01 -0700, KrispyData
wrote:

I have an address field and I would like to create a formula to retrieve the
first 3 words in the address. How can I do this?

example:

1245 main street suite 10

i would like the result to be:

1245 main street

thanks so much for any help!



=LEFT(TRIM(A1),FIND(CHAR(1),SUBSTITUTE(TRIM(A1)&" "," ",CHAR(1),3))-1)
--ron
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
Retrieve cell value Gisela Excel Discussion (Misc queries) 3 August 27th 09 11:08 PM
Retrieve cell value basis the inputs into a diff cell // sk. sansk_23 Excel Worksheet Functions 5 December 16th 07 08:06 AM
Help - retrieve cell address ppbedz Excel Discussion (Misc queries) 5 April 17th 06 10:45 PM
How do I dynamically retrieve the cell address of the last cell t. Nancy Excel Discussion (Misc queries) 1 December 20th 04 02:52 PM
Retrieve last cell with data JimDandy Excel Worksheet Functions 2 November 20th 04 06:50 PM


All times are GMT +1. The time now is 01:30 AM.

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"