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

I would make one suggested modification though... change your SEARCH to be
for "_at_"


Yep, good point!

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
See... I knew that had to be better approach than the
bull-in-the-china-shop approach I used.<g Thanks for posting it. I would
make one suggested modification though... change your SEARCH to be for
"_at_" (that is, <spaceat<space) on the off chance that some of the
other words in the text have "at" embedded within them.

Rick


"T. Valko" wrote in message
...
I'm willing to bet there is a shorter solution available


=LOOKUP(1000,--MID(A1,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 "))))

Even shorter (but array entered) using defined names:

Nums: ={0,1,2,3,4,5,6,7,8,9}
Length: =ROW(INDIRECT("1:255"))

=LOOKUP(1000,--MID(A1,MIN(FIND(Nums,A1&Nums,SEARCH("at",A1))),Len gth))

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Sorry, small revision... I forgot about there may be nothing after the
number. Try this formula instead of the one I posted earlier...

=LEFT(MID(MID(A1,SEARCH(" at
",A1)+1,255),MIN(FIND({0,1,2,3,4,5,6,7,8,9},MID(A1 &" ",SEARCH(" at
",A1&" ")+1,255)&{0,1,2,3,4,5,6,7,8,9})),255),FIND(" ",MID(MID(A1&"
",SEARCH(" at
",A1)+1,255),MIN(FIND({0,1,2,3,4,5,6,7,8,9},MID(A1 ,SEARCH(" at
",A1)+1,255)&{0,1,2,3,4,5,6,7,8,9})),255))-1)

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
It's ugly (and I'm willing to bet there is a shorter solution
available), but the following formula will return the last number in A1
as long as the work "at" appears in the text...

=LEFT(MID(MID(A1,SEARCH(" at
",A1)+1,255),MIN(FIND({0,1,2,3,4,5,6,7,8,9},MID(A1 ,SEARCH(" at
",A1)+1,255)&{0,1,2,3,4,5,6,7,8,9})),255),FIND (" ",MID(MID(A1,SEARCH("
at ",A1)+1,255),MIN(FIND({0,1,2,3,4,5,6,7,8,9},MID(A1 ,SEARCH(" at
",A1)+1,255)&{0,1,2,3,4,5,6,7,8,9})),255))-1)

Rick


"Jambruins" wrote in message
...
In cell B239 I have the following text
Carolina 3 at Pittsburgh 4 (SO)

All of column B is like this except with different team names.

I would like a formula to pull out the number 4. Any idea how to do
this?
I have been trying to use the right command with the find command but
I can't
quite get it. Thanks.









 
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 04:13 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"