Are you saying you can't get it to work in the sample file or you can't adapt it ? If you apply the steps to the sample file it should work without incident.
In terms of what it does...
The first formula on billing sheet creates a KEY code, the code is a concatenation of the count of times the address has appeared up to and including the current row and the address itself, eg:
1:Address1
1:Address2
2:Address1
3:Address1
etc...
it is the Key that allows you to create the table of Plan Codes relatively efficiently (without need for Arrays etc...)
Regards the formulae on the 2nd sheet, the first in Column F:
is as you say used to determine how many times the given address appears on the Billing sheet, however, it first checks to see if the address has already been listed on the current sheet and if so just uses prior calculated result given the result is the same - no need to recalculate the COUNTIF.
The second formula used to populate the matrix returns the plans based on the combination of Address and number (row 1) by using the KEY column on Billing sheet,
eg if header row is 1 and Address is "Address" the formula:
will look in they new KEY column for "1:Address" ... and will return the associated value from column B (plan)... note it will only look for a plan where the KEY will exist, ie if header > column F then there is no plan to retrieve (given the #:address won't exist)....
in the above this is done by using COLUMNS>F but in reality it might make more sense (logically) to use G$1>$F2.
It is of paramount importance therefore that the headers in G1 onwards are 1 to n where n is determined by the most no. of plans any one Address has listed on Billing sheet (in your sample this was I believe 19).
Bookmarks