Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Find character in a string

Thanks for any help.
How can I get Everytthing to the left of a character.
Examples od data
Tobacco Outlet #1
TRO #1
Tobacco Road Outlet #1
Needs to return 1
Tobacco Outlet #1201
TRO #1201
Tobacco Road Outlet #1201
Needs to return 1201
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Find character in a string

you don't mention if you have need for a formula or a macro:

here's a formula, write back with more info about the sheet layout if you
want code.

=RIGHT(A1,LEN(A1)-FIND("#",A1))

--

Gary


"Mike" wrote in message
...
Thanks for any help.
How can I get Everytthing to the left of a character.
Examples od data
Tobacco Outlet #1
TRO #1
Tobacco Road Outlet #1
Needs to return 1
Tobacco Outlet #1201
TRO #1201
Tobacco Road Outlet #1201
Needs to return 1201


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Find character in a string

Gary
For some reason my messages are getting an error so no telling how many
replies will show up.
I get an #value! with the formula
Sorry so short on prior post

I will be passing the value to a ADODB.RECORDSET

"Gary Keramidas" wrote:

you don't mention if you have need for a formula or a macro:

here's a formula, write back with more info about the sheet layout if you
want code.

=RIGHT(A1,LEN(A1)-FIND("#",A1))

--

Gary


"Mike" wrote in message
...
Thanks for any help.
How can I get Everytthing to the left of a character.
Examples od data
Tobacco Outlet #1
TRO #1
Tobacco Road Outlet #1
Needs to return 1
Tobacco Outlet #1201
TRO #1201
Tobacco Road Outlet #1201
Needs to return 1201



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Find character in a string

On Wed, 20 Feb 2008 18:44:00 -0800, Mike
wrote:

Gary
For some reason my messages are getting an error so no telling how many
replies will show up.
I get an #value! with the formula
Sorry so short on prior post

I will be passing the value to a ADODB.RECORDSET


You will get a #VALUE! error if the "#" token is not in the string being
processed.
--ron
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Find character in a string

Ron I'm getting the value sign and I for sure that there is the "#" in the cell

"Ron Rosenfeld" wrote:

On Wed, 20 Feb 2008 18:44:00 -0800, Mike
wrote:

Gary
For some reason my messages are getting an error so no telling how many
replies will show up.
I get an #value! with the formula
Sorry so short on prior post

I will be passing the value to a ADODB.RECORDSET


You will get a #VALUE! error if the "#" token is not in the string being
processed.
--ron



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Find character in a string

On Wed, 20 Feb 2008 19:51:01 -0800, Mike
wrote:

Ron I'm getting the value sign and I for sure that there is the "#" in the cell


Copy/paste a cell with your data that is returning the #VALUE error, and also
copy/paste the formula you are using that is returning that error to a message
here, so we can see exactly what is there with no possible typos.

If the cell with the data is from a formula, post that here, too.

Were you able to use the "trace error" option from the little button that might
show up when you select the cell showing the error?
--ron
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default Find character in a string

With
A1: (a text value ending in a number.....eg Tobacco Outlet #1201)

This formula returns the numbers:
B1: =MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"01234 56789")),99)*1

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Mike" wrote in message
...
Thanks for any help.
How can I get Everytthing to the left of a character.
Examples od data
Tobacco Outlet #1
TRO #1
Tobacco Road Outlet #1
Needs to return 1
Tobacco Outlet #1201
TRO #1201
Tobacco Road Outlet #1201
Needs to return 1201



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
FIND 2nd character in a string Fuzzy Excel Worksheet Functions 7 September 1st 09 08:14 AM
find a character in a string kevcar40 Excel Discussion (Misc queries) 4 June 5th 07 12:10 PM
Find Character Position in String SportsDave Excel Programming 6 May 21st 06 09:49 PM
Find nth instance of a character in a string Francis Hayes (The Excel Addict) Excel Discussion (Misc queries) 7 January 21st 05 03:44 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


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