View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default Learning arrays.

"David Farber" wrote:
Now my question is, which I have been unable to figure
out by experimentation, what is the correct result of:
SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789") assuming
for example that A1 contains a city, state, and zip?
You said it would produce an array.


And it does. But if you simply array-enter (press ctrl+shift+Enter):

=SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")

into a single cell, Excel assumes you want to select a single element of the
array, the first element in this case.

You should have array-entered (press ctrl+shift+Enter):

=MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789") )

It is MIN that knows what to do with the array.

If you want to see the array returned by array-entering that SEARCH
expression, use the Evaluate Formula operation. (It is available in Excel
2003. I don't know about Excel 2002.)

Alternatively, select B1:K1 (a row of 10 cells, not a column), type the
following formula:

=SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")

then press ctrl+shift+Enter.