ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   extract word before / (https://www.excelbanter.com/excel-discussion-misc-queries/227197-extract-word-before.html)

Wanna Learn

extract word before /
 
Hello I want to extract the word or words before the " /" example the
cell reads University of Texas/TX so I need to extract University of Texas .
I tried right and left functions but it does not work. the cells always has
the name of the university then / initials of the state thanks in advance

Dave Peterson

extract word before /
 
=search("/",a1)
will give you the position of the slash.

So
=left(a1,search("/",a1)-1)
will give you the stuff before the slash.

If there's a chance that you don't have slashes in the data, you could use:
=left(a1,search("/",a1&"/")-1)

It'll avoid the error.

Wanna Learn wrote:

Hello I want to extract the word or words before the " /" example the
cell reads University of Texas/TX so I need to extract University of Texas .
I tried right and left functions but it does not work. the cells always has
the name of the university then / initials of the state thanks in advance


--

Dave Peterson

Luke M

extract word before /
 
How about this?

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

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


"Wanna Learn" wrote:

Hello I want to extract the word or words before the " /" example the
cell reads University of Texas/TX so I need to extract University of Texas .
I tried right and left functions but it does not work. the cells always has
the name of the university then / initials of the state thanks in advance


FSt1

extract word before /
 
hi
if the cells always has the name of the university then / initials of the
state,
try text to columns using the back slash as a delimiter.

on the 03 menu bardatatext to columnsfollow the wizard.

Regards
FSt1

"Wanna Learn" wrote:

Hello I want to extract the word or words before the " /" example the
cell reads University of Texas/TX so I need to extract University of Texas .
I tried right and left functions but it does not work. the cells always has
the name of the university then / initials of the state thanks in advance



All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com