#1   Report Post  
giantwolf
 
Posts: n/a
Default Left() or Right()


Hi,

I have a list of postcodes (zip codes) that I need to 'extract' part of
and allocate to a new cell.

eg:

AL1 2TQ
AL1 5RD
AL22 9IP

I need to take the first characters before the space however it could
be 3 or 4 characters before each space. I need a formula that will
start from the left and take anything before a space or one that starts
from the right and takes anything before the righthand 3 characters and
the space. I've tried left and right but can't quite get it to work.

Any ideas? Thanks in advance.


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=396875

  #2   Report Post  
DaveB
 
Posts: n/a
Default

Assume the value is in cell A1:

To extract to the left of the space:
=LEFT(A1,SEARCH(" ",A1))

To extract to the right of the space:
=RIGHT(A1,LEN(A1)-SEARCH(" ",A1))
--
Regards,

Dave


"giantwolf" wrote:


Hi,

I have a list of postcodes (zip codes) that I need to 'extract' part of
and allocate to a new cell.

eg:

AL1 2TQ
AL1 5RD
AL22 9IP

I need to take the first characters before the space however it could
be 3 or 4 characters before each space. I need a formula that will
start from the left and take anything before a space or one that starts
from the right and takes anything before the righthand 3 characters and
the space. I've tried left and right but can't quite get it to work.

Any ideas? Thanks in advance.


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=396875


  #3   Report Post  
BenjieLop
 
Posts: n/a
Default


giantwolf Wrote:
Hi,

I have a list of postcodes (zip codes) that I need to 'extract' part of
and allocate to a new cell.

eg:

AL1 2TQ
AL1 5RD
AL22 9IP

I need to take the first characters before the space however it could
be 3 or 4 characters before each space. I need a formula that will
start from the left and take anything before a space or one that starts
from the right and takes anything before the righthand 3 characters and
the space. I've tried left and right but can't quite get it to work.

Any ideas? Thanks in advance.


Try this ...

=LEFT(A1,FIND(\" \",A1)-1)

and copy down as required.

Regards.


--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=396875

  #4   Report Post  
Dave O
 
Posts: n/a
Default

Assuming your sample data is in cells A1:A3, you can use the FIND()
function to locate the space, and use it as an argument in the MID()
function. MID() is similar to LEFT() and RIGHT() but allows you to
select the start and stop columns.

In cell B1 I used the formula
=MID(A1,1,FIND(" ",A1,1)-1)

In cell C1 I used
=MID(A1,FIND(" ",A1,1)+1,LEN(A1))

  #5   Report Post  
giantwolf
 
Posts: n/a
Default


Thanks to all 3 of you for your help, they all worked great. Much
appreciated.

GW


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=396875



  #6   Report Post  
RagDyer
 
Posts: n/a
Default

FWIW,

Your suggested formula is being distorted when displaying in my O.E. reader.

I see your formula in upper case, like it was copied directly from the XL
formula bar, and the <space is depicted as
\" \"
backslash,dbl quote,space,backslash,dbl quote.

I had to go into excelforum to see your actual formula,
which was in lower case, as you might have typed it directly into the post,
and the space was properly displayed between 2 dbl quotes.

Does anyone know why ???
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"BenjieLop" wrote
in message ...

giantwolf Wrote:
Hi,

I have a list of postcodes (zip codes) that I need to 'extract' part of
and allocate to a new cell.

eg:

AL1 2TQ
AL1 5RD
AL22 9IP

I need to take the first characters before the space however it could
be 3 or 4 characters before each space. I need a formula that will
start from the left and take anything before a space or one that starts
from the right and takes anything before the righthand 3 characters and
the space. I've tried left and right but can't quite get it to work.

Any ideas? Thanks in advance.


Try this ...

=LEFT(A1,FIND(\" \",A1)-1)

and copy down as required.

Regards.


--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile:

http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=396875


  #7   Report Post  
BenjieLop
 
Posts: n/a
Default


RD,

I really have no idea why this is happening. I have asked around to
check if they are experiencing the same thing as you are and,
unfortunately, no one has. I guess this is one of the things that we
have to put up with in this high tech world that we live in right now.



RagDyer Wrote:
FWIW,

Your suggested formula is being distorted when displaying in my O.E.
reader.

I see your formula in upper case, like it was copied directly from the
XL
formula bar, and the <space is depicted as
\" \"
backslash,dbl quote,space,backslash,dbl quote.

I had to go into excelforum to see your actual formula,
which was in lower case, as you might have typed it directly into the
post,
and the space was properly displayed between 2 dbl quotes.

Does anyone know why ???
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit
!
---------------------------------------------------------------------------

"BenjieLop"
wrote
in message
...

giantwolf Wrote:
Hi,

I have a list of postcodes (zip codes) that I need to 'extract'

part of
and allocate to a new cell.

eg:

AL1 2TQ
AL1 5RD
AL22 9IP

I need to take the first characters before the space however it

could
be 3 or 4 characters before each space. I need a formula that

will
start from the left and take anything before a space or one that

starts
from the right and takes anything before the righthand 3 characters

and
the space. I've tried left and right but can't quite get it to

work.

Any ideas? Thanks in advance.


Try this ...

=LEFT(A1,FIND(\" \",A1)-1)

and copy down as required.

Regards.


--
BenjieLop



------------------------------------------------------------------------
BenjieLop's Profile:

http://www.excelforum.com/member.php...o&userid=11019
View this thread:

http://www.excelforum.com/showthread...hreadid=396875



--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=396875

  #8   Report Post  
RagDyer
 
Posts: n/a
Default

Here's where Biff saw the same thing and commented on it just a few days
ago:

http://tinyurl.com/dtr8t


--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"BenjieLop" wrote
in message ...

RD,

I really have no idea why this is happening. I have asked around to
check if they are experiencing the same thing as you are and,
unfortunately, no one has. I guess this is one of the things that we
have to put up with in this high tech world that we live in right now.



RagDyer Wrote:
FWIW,

Your suggested formula is being distorted when displaying in my O.E.
reader.

I see your formula in upper case, like it was copied directly from the
XL
formula bar, and the <space is depicted as
\" \"
backslash,dbl quote,space,backslash,dbl quote.

I had to go into excelforum to see your actual formula,
which was in lower case, as you might have typed it directly into the
post,
and the space was properly displayed between 2 dbl quotes.

Does anyone know why ???
--
Regards,

RD


--------------------------------------------------------------------------

-
Please keep all correspondence within the NewsGroup, so all may benefit
!


--------------------------------------------------------------------------

-

"BenjieLop"
wrote
in message
...

giantwolf Wrote:
Hi,

I have a list of postcodes (zip codes) that I need to 'extract'

part of
and allocate to a new cell.

eg:

AL1 2TQ
AL1 5RD
AL22 9IP

I need to take the first characters before the space however it

could
be 3 or 4 characters before each space. I need a formula that

will
start from the left and take anything before a space or one that

starts
from the right and takes anything before the righthand 3 characters

and
the space. I've tried left and right but can't quite get it to

work.

Any ideas? Thanks in advance.

Try this ...

=LEFT(A1,FIND(\" \",A1)-1)

and copy down as required.

Regards.


--
BenjieLop



------------------------------------------------------------------------
BenjieLop's Profile:

http://www.excelforum.com/member.php...o&userid=11019
View this thread:

http://www.excelforum.com/showthread...hreadid=396875



--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile:

http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=396875


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
Sort Left to Right not working Juan Excel Discussion (Misc queries) 3 July 29th 05 07:26 PM
Cell Borders and "Columns to Repeat at Left" DeLeo Excel Discussion (Misc queries) 0 July 28th 05 03:41 PM
Scrollbar on Chart Jumps to Left when Chart is Clicked Bob Charts and Charting in Excel 5 May 1st 05 02:06 AM
The left function does not work when displaying times, how is thi. Nambo27 Excel Worksheet Functions 3 February 25th 05 06:46 PM
header in right or left margin? Michelle Excel Discussion (Misc queries) 2 January 26th 05 04:44 PM


All times are GMT +1. The time now is 02:26 PM.

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

About Us

"It's about Microsoft Excel"