Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Text to the left and right of a character

I have a list of file names (Music), the format is "Beatles - Yellow
Submarine" in cells a1 to a10000 (for arguments sake). I want to have
in B1 - Beatles and in C1 - Yellow Submarine.

All files are the same format (Beatles - Yellow Submarine.mp3)

What formulas would I use to get the text to the left of "-" and text
to the right of "-"? Any helpers greatly appreciated

Esra
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Text to the left and right of a character

Did you mention the filenames with the mp3 extension for a reason? I'm
assuming the first part of your post (no .mp3) is what is in Column A. See
if these formula do what you want...

B1: =TRIM(LEFT(A1, FIND("-",A1)-1))
C1: =TRIM(MID(A1,FIND("-",A1)+1,255))

Rick


"Esra" wrote in message ...
I have a list of file names (Music), the format is "Beatles - Yellow
Submarine" in cells a1 to a10000 (for arguments sake). I want to have
in B1 - Beatles and in C1 - Yellow Submarine.

All files are the same format (Beatles - Yellow Submarine.mp3)

What formulas would I use to get the text to the left of "-" and text
to the right of "-"? Any helpers greatly appreciated

Esra


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Text to the left and right of a character

=LEFT(A2,FIND(" - ",A2)-1)
=RIGHT(A2,LEN(A2)-FIND(" - ",A2)-2)
--
David Biddulph

<Esra wrote in message ...
I have a list of file names (Music), the format is "Beatles - Yellow
Submarine" in cells a1 to a10000 (for arguments sake). I want to have
in B1 - Beatles and in C1 - Yellow Submarine.

All files are the same format (Beatles - Yellow Submarine.mp3)

What formulas would I use to get the text to the left of "-" and text
to the right of "-"? Any helpers greatly appreciated

Esra



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Text to the left and right of a character

=LEFT(A1,FIND("-",A1)-2) gets you Beatles
=MID(A1,FIND("-",A1)+2,256) get Yellow Submarine.mp3
=MID(A2,FIND("-",A1)+2,LEN(A1)-FIND("-",A1)-5) gets Yellow Submarine

But have you looked into Data | Text to Columns ?
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

<Esra wrote in message ...
I have a list of file names (Music), the format is "Beatles - Yellow
Submarine" in cells a1 to a10000 (for arguments sake). I want to have
in B1 - Beatles and in C1 - Yellow Submarine.

All files are the same format (Beatles - Yellow Submarine.mp3)

What formulas would I use to get the text to the left of "-" and text
to the right of "-"? Any helpers greatly appreciated

Esra



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Text to the left and right of a character

On Jan 29, 11:26*am, "Rick Rothstein \(MVP - VB\)"
wrote:
Did you mention the filenames with the mp3 extension for a reason? I'm
assuming the first part of your post (no .mp3) is what is in Column A. See
if these formula do what you want...

B1: * *=TRIM(LEFT(A1, FIND("-",A1)-1))
C1: * *=TRIM(MID(A1,FIND("-",A1)+1,255))

Rick



"Esra" wrote in messagenews:4gksp3tpo0f4hsdb836fnm6t8opilrnrbd@4ax .com...
I have a list of file names (Music), the format is "Beatles - Yellow
Submarine" in cells a1 to a10000 (for arguments sake). *I want to have
in B1 - Beatles and in C1 - Yellow Submarine.


All files are the same format (Beatles - Yellow Submarine.mp3)


What formulas would I use to get the text to the left of "-" and text
to the right of "-"? *Any helpers greatly appreciated


Esra- Hide quoted text -


- Show quoted text -


Works just fine thank you so much, and thanks to all who answered.
I mentioned mp3 not for any specific reason, I just have to
delete .mp3 before I can get the correct value, easy enough to do.

Again thank you
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
Returning left part of cell before a character Alan Excel Discussion (Misc queries) 6 April 4th 23 02:26 PM
Get characters on left of specified character in Excel Murugan Excel Discussion (Misc queries) 3 April 2nd 23 04:15 PM
Test left character is a number? nastech Excel Discussion (Misc queries) 7 October 5th 15 06:05 PM
Limit character count in cell from left BMF Excel Discussion (Misc queries) 5 July 12th 06 06:11 PM
How to edit column data so that all but left most character remain Max Prophet Excel Discussion (Misc queries) 1 June 29th 06 06:18 PM


All times are GMT +1. The time now is 05:17 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"