UDF - User Defined Function (VBA Function)
The demo. illustrated by shg will be relatively expensive performance wise given use of Arrays in conjunction with Volatile Named Range construct (OFFSET)
Using Post # 3 as an example such that A1:B13 contains:
another way of creating a (dynamic) unique listing in C would be to do the following:
the above tells us is one calc. how many unique customers we have.
What we do next depends rather on whether or not the Customer ID's (Col A) are sorted alphabetically or not ?
All the implications thus far are that, yes, the codes are sorted in which case:
You will note that surplus rows are populated with #N/A errors - this is deliberate and is to assist us in creating our Dynamic Named Range (DNR) for use in Validation... we thus create a DNR as follows:
We can now use this Name in a given cell as source for DV
If your Customer ID's are not sorted alphabetically then things will become a little more expensive formulae wise in terms of generating the unique listings ... when dealing with large volumes of data it is always wise to sort the data appropriately as this generally permits efficiency gains long-term.
Bookmarks