View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Blue Max Blue Max is offline
external usenet poster
 
Posts: 113
Default Returning an array of unique values?

Thank you for the reply, Alan. My questions were intended to be general so
that I could use the specific techniques for modifying arrays in different
situations. Nevertheless, here is an example if it will help explain your
'Yes' answers to our three questions:

The sample formula
{=IF(FREQUENCY(MATCH(A1:A8,A1:A8,0),MATCH(A1:A8,A1 :A8,0))0,INDEX(A1:A8,MATCH(A1:A8,A1:A8,0)),"")}
is entered as an array formula in the range A10:A17. The source range A1:A8
in the formula is simply a test column of 8 cells with the entries Banana,
Apple, Apple, Banana, Orange, Pineapple, Orange, and Nut. The formula
returns a listing of unique fruits to the destination range A10:A17 of
Banana, Apple, "", "", Orange, Pineapple, "", Nut.

As you can see, the formula successfully extracts the unique values of the
source range and keeps them properly updated in the destination range as
values are modified in the source range. The problem here is that the
resulting destination list is interspersed with blank cells. We want to
eliminate the blank cells from the destination range and list the unique
values sequentially at the top of the range. At some point we my also wish
to have the formula sort the resulting unique values before placing them in
the destination range of cells.

This technique is often useful in accounting where the user needs to
identify all the unique General Ledger Accounts in a very long list of
detail transactions which are repeatedly associated with the same set of
account numbers. After identifying the unique accounts, then the user can
summarize all of the transaction amounts by account number. Obviously,
there are hundreds of other similar examples where the user desires to
summarize a subset of data from a larger population.

As you indicate that all three of our tasks could be performed as described,
we hope that the examples will help you give us a little more insight. As
you probably noticed, all our questions dealt with modifying an array within
a formula, so that it could be further processed within the formula before a
result was output to the destiation cells. Obviously, we are struggling to
find standard functions or techniques that allow us to modify these arrays
within the formula. We are also interested in knowing if a user could link
the original database to a smaller pivot table, beneath the original data,
designed to resummarize the original data in the desired format.

Thanks,
Blue

**********
"Alan Beban" wrote in message
...
Blue Max wrote:
Is there anyway, using a formula, to return an array of unique values
extracted from a larger array that has duplicate values. The resulting
array would be used for further calculations in the rest of the formula?

Likewise, is there anyway to use the values (true, false) in one array to
determine which values are selected out of another array for creating a
resulting array to be used for further calculations in the formula?

Can an array be sorted within a formula before using it in the balance of
the formula?

I am able to generate an array including all the values I need, but I
cannot get rid of the duplicate values in that array. Thank you for any
help.

It might help us to help you if you post the formula; that way we can see
how the array is to be used for further calculations.

The answers to your 3 questions are yes, yes, yes.

Alan Beban