A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

find a number in a cell



 
 
Thread Tools Display Modes
  #21  
Old October 23rd, 2007, 04:19 AM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default find a number in a cell

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



  #22  
Old October 23rd, 2007, 05:36 AM posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\)
external usenet poster
 
Posts: 1,319
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
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.