View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Match forst four letters

Ah yes, now I see it. I've done similar things many times in the past...it's
just been a loooonnnng day today...

There are (at least) two solutions:
=INDEX($A$5:$A$1000,MATCH(H8&"*",$A$5:$A$1000,0))

=INDEX($A$5:$A$1000,MATCH(LEFT(TRIM(H8),4)&"*",$A$ 5:$A$999,0))
(with the second giving the same results as the first because all the spaces
have been trimmed from all the cells already...)


Thanks everyone!!
Ryan---

--
RyGuy


"Harlan Grove" wrote:

"Peo Sjoblom" wrote...
You would need to put the LEFT function on the range where the
lookup/match is made

=MATCH(A3,LEFT(D3:D6,4),0)

....

If A3 had exactly 4 characters, when would this return something
different than

=MATCH(A3&"*",D3:D6,0)

?

More robust, why not use

=MATCH(LEFT(TRIM(A3),4)&"*",D3:D6,0)

?

These will all return the first match, whether or not that's the match
sought.