LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #19   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default find a number in a cell

I'm not 100% sure why this works, but it does seem to work. This formula
removes one of the SUBSTITUTE function calls and arrays the "find me" text
(saving some 15 characters in the process)... and it seems to always return
the correct answer too:

=LOOKUP(1000,--MID(SUBSTITUTE(LOWER(A1),{"a","p"},"z"),MIN(FIND({ 0,1,2,3,4,5,6,7,8,9},A1&{0,1,2,3,4,5,6,7,8,9},SEAR CH("
at ",A1))),ROW(INDIRECT("1:255"))))

Rick


"T. Valko" wrote in message
...
Yeah, that'll work. I didn't have time to dig any deeper and look for a
tweak.

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
So, as long as the next character after the last number that
is <12 < "a" it will work!


Well, not exactly... if the character is a "p", you will have the same
problem (for the same reason). Here is a patch to your formula to fix
this problem...

=LOOKUP(1000,--MID(SUBSTITUTE(SUBSTITUTE(LOWER(A1),"a","z"),"p"," z"),MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&{0,1,2,3,4,5 ,6,7,8,9},SEARCH("
at ",A1))),ROW(INDIRECT("1:255"))))

Yes, your formula is now longer, but it still is around half the size of
the one I posted.

Rick




 
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
formula to find how many cell have a number between 2 numbers. SCOTTAFRED Excel Worksheet Functions 3 October 19th 07 06:05 PM
Is there a way to find out whether theres a number in a cell?? [email protected] Excel Discussion (Misc queries) 7 June 29th 07 02:29 PM
Can I find the number of letters in a cell? dave_laroche Excel Discussion (Misc queries) 4 April 30th 07 07:17 PM
Find the 1st occurance of a number in a cell lovemuch Excel Worksheet Functions 4 August 17th 06 01:02 AM
find the cell above any number in any range steve alcock Excel Worksheet Functions 12 May 27th 05 05:48 AM


All times are GMT +1. The time now is 10:13 AM.

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"