View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Compare One Cell to the First 10 Characters of Another Cell

On Wed, 12 Mar 2008 16:59:00 -0700, Jill
wrote:

I would like to compare one cell (A1) to the first 10 characters in a range
of cells (B1:B125). If there is a match, I would like it displayed in C1.

Any help would be appreciated.


Not sure what you mean by "a match". Or what "it" is that you want displayed.

If, by "a match", you mean to say that a match exists if the contents of A1 are
duplicated somewhere within the first 10 characters in the range of column B;
and if, by "it", you mean to display the contents of the cell in B that
contained a1, then something like:

=LOOKUP(2,1/SEARCH(A1,LEFT(B1:B125,10)),B1:B125)

might be what you are looking for.

If you mean something else, you'll have to be more specific.
--ron