Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jordan
 
Posts: n/a
Default Finding char within a cell

I have a column of account numbers listed as follows:

US1234
6789
1234-12345
ABC/ABC62

What I am trying to do is to take the text and/or numbers before the "-" or
the "/".
I have tried using the find function which will give me the location and
then I can subtract that from the length and use the right fuction.

The problem I'm having is I cant figure out how to have the find function
return the location whether or not it's the - or the /.

Any help will be greatly appreciated.

Jordan


  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Thu, 16 Jun 2005 15:20:03 -0700, Jordan
wrote:

I have a column of account numbers listed as follows:

US1234
6789
1234-12345
ABC/ABC62

What I am trying to do is to take the text and/or numbers before the "-" or
the "/".
I have tried using the find function which will give me the location and
then I can subtract that from the length and use the right fuction.

The problem I'm having is I cant figure out how to have the find function
return the location whether or not it's the - or the /.

Any help will be greatly appreciated.

Jordan

Try this:


=IF((COUNTIF(A1,"*-*")+COUNTIF(A1,"*/*"))=0,A1,
MID(A1,FIND(CHAR(1),SUBSTITUTE(
SUBSTITUTE(A1,"-",CHAR(1)),"/",CHAR(1)))+1,255))


--ron
  #3   Report Post  
Gary's Student
 
Posts: n/a
Default

How about using find/replace to change all the "/" into "-". Then use Data
Text to columns to separate the text into two pieces?
--
Gary's Student


"Jordan" wrote:

I have a column of account numbers listed as follows:

US1234
6789
1234-12345
ABC/ABC62

What I am trying to do is to take the text and/or numbers before the "-" or
the "/".
I have tried using the find function which will give me the location and
then I can subtract that from the length and use the right fuction.

The problem I'm having is I cant figure out how to have the find function
return the location whether or not it's the - or the /.

Any help will be greatly appreciated.

Jordan


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
Function syntax to compare cell contents ES Excel Worksheet Functions 2 May 18th 05 03:53 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Syntax for inferred cell references donesquire Excel Worksheet Functions 4 April 4th 05 09:29 PM
inserting data from a row to a cell, when the row number is specified by a formula in a cell [email protected] New Users to Excel 2 January 6th 05 07:18 AM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


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