Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default search string with condition

I have a range of cells with text and numbers. I need to search the range of
cells for the string with a condition ie, spare-1, spare-2,etc. then
determine what the maximum number is after the "-". assistance is greatly
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default search string with condition

Assuming those entries are in A1:A10, use this array* formula:

=MAX(--RIGHT(A1:A10,LEN(A1:A10)-FIND("-",A1:A10)))

* An array formula has to be committed using Ctrl-Shift-Enter (CSE)
rather than the usual <Enter. If you do this correctly then Excel
will wrap the formula in curly braces { } when viewed in the formula
bar - do not type these yourself. If you subsequently amend/edit the
formula you must use CSE again.

Hope this helps.

Pete


On Jan 18, 1:26*am, pburk wrote:
I have a range of cells with text and numbers. *I need to search the range of
cells for the string with a condition ie, spare-1, spare-2,etc. *then
determine what the maximum number is after the "-". *assistance is greatly
appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default search string with condition

Hi,

Try this array formula

=MAX(IF(ISNUMBER(FIND("-",A1:A22)),-MID(A1:A22,FIND("-",A1:A22),10),""))

To enter this as an array press Shift+Ctrl+Enter instead of Enter.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"pburk" wrote:

I have a range of cells with text and numbers. I need to search the range of
cells for the string with a condition ie, spare-1, spare-2,etc. then
determine what the maximum number is after the "-". assistance is greatly
appreciated.

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
search for data matching some condition Michael Hahn Excel Worksheet Functions 2 July 18th 07 06:48 PM
How to search a string from the right ? EuroMaverick Setting up and Configuration of Excel 2 March 28th 07 09:20 PM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM
Extract String based on condition Send Object Command - Two attachments Excel Discussion (Misc queries) 4 November 1st 05 09:06 PM
how to search in excel with condition David Excel Discussion (Misc queries) 1 February 8th 05 09:23 PM


All times are GMT +1. The time now is 02:39 AM.

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"