View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Compare One Cell to the First 10 Characters of Another Cell

Say A1 contains a123456789

and B1 thru B12 contain:

xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
a123456789gjsjgfjhgrfwjh
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx


Then in C1 enter:

=OFFSET($B$1,MATCH(A1,LEFT(B1:B12,10),1)-1,0)

This is an array formula that is entered with CNTRL-SHFT-ENTER rather than
just ENTER
--
Gary''s Student - gsnu200773


"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.

--
Jill