Forum Discussion
Any to any comparison in excel
- Nov 07, 2023
samery Are you using Excel for MS365? If so, here's a couple of recursive formulas you could try. However, they will only return the most optimized combination of vendors...
To return a summary of the optimal combination of vendors with their total items covered, try the following formula in any cell (with nothing below it):
=LET( F, LAMBDA(X,head,data,val, LET( a, BYCOL(data, LAMBDA(col, SUM(col))), b, MAX(a), c, XMATCH(b, a), IF(b=0, val, X(X, head, FILTER(data, INDEX(data,, c)=0, 0), VSTACK(val, HSTACK(INDEX(head, c), b)))))), F(F, C1:Q1, C2:Q231, {"Company","Total Covered"}))With your current data, the results should look something like this:
Company Total Covered S&P 138 Oxford eco0mics 28 ECONDB 20 Kpler 11 blue water 5 alphaliner 2 economist intelligence 2 Sinay 1 Oxford Analytica 1 TDM 1 To return a detailed list of the optimal combination of vendors with all of their items covered, try the following formula in any cell (will nothing below it):
=LET( F, LAMBDA(X,head,data,val, LET( a, BYCOL(data, LAMBDA(col, SUM(col))), b, MAX(a), c, XMATCH(b, a), d, INDEX(head, c), IF(b=0, val, X(X, head, FILTER(data, INDEX(data,, c)=0, 0), VSTACK(val, IFNA(HSTACK(d, FILTER(TAKE(data,, 1), INDEX(data,, c)=1)), d)))))), F(F, B1:Q1, B2:Q231, {"Company","Items Covered"}))Finally, to return a list of all items not covered by any vendor, try the following formula in any cell (with nothing below it):
=LET( data, B2:Q231, qty, BYROW(data, LAMBDA(r, SUM(r))), VSTACK("Items Not Covered", FILTER(TAKE(data,, 1), qty=0, "none")))It's a start, anyways. I'll think about it some more and try to find a way to generate other combinations of vendors.
hi again
I promise I will leave you alone after this last post so please bear with me.
you noticed I hinted earlier some other complications related to variables such as refresh rate and scope.
I tried to adjust your great work all by myself but I didnt know how to do it.
First: Please check the attached book2.xls, tab Raw data, it has the actual replica of what I have along with 2 other descriptive fields for every variable: the refresh rate and the scope. I know that this data is not available for all variables.
Second: now please go back to the 2nd tab you created, basically I am supposed to add couple of more fields for every data from the raw data tab so that the client would know what exactly he is buying. Obviously, I should pickup the refresh rate and the scope of the relevant vendor.
Such information should help my client to decide whether or not to buy a particular variable form Vendor X for example if the scope is weak. I also added another simple sum small column next to the nice table you put on the top left on coverage only so that the client will visually see how much before and after, meaning how much client should consumer form vendor vs how much vendor is proving as a simple sum.
do you think you can help me with that as well?
many thanks in advance.
Regards
Samer.
samery Please see the newly attached workbook (Book3.xlsx). I moved all of the custom functions to Name Manager and added the ability for you to manually select multiple vendors (up to 5). They will be prioritized in the order you choose, then all subsequent vendors will automatically be filled based on the number of remaining items they can cover.
In order to get the Refresh and Scope variables to pull in, I had to modify the headers slightly on the RawData sheet... all merged headers were unmerged and repeated across their applicable columns. I also verified the Target Data labels on Sheet1 were identical to those on the RawData sheet. All headers and labels must match in order to pull in the additional information.
I wasn't exactly sure what you wanted the Full Coverage column to do, so I set it up to pull the values from the total row on Sheet1 for each vendor in the list. If that's not what you wanted, please try to explain it again.
- sameryNov 08, 2023Copper Contributorhi djclements
I think the addition of up to 5 is more then what I expected. There was few variables that have bad coverage so to speak so I wanted to show the client that from a formula standpoint, that's how variables are distributed but client to decide which coverage to consider or not. Warm thanks.
The totals I mentioned are exactly what you presented: how much client offers vs how much client needs.
I think the work is amazing and I am really and obsoletely thankful.