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.
samery Just wondering, is the file you provided complete? There currently are no scenarios where all of the variables are covered. If you filter out all of the 1's, you're left with a list of 21 variables that none of the companies are covering.
yes that is correct. At the moment, we noticed that some of the vendors are unable to provide the variables that we wish to have. As such, we are going to have to exclude them for now.
But the table is complete. The list of 200+ rows are the variables on the B column that are actual variables that you can buy from data providers. On the columns side you will find vendors that provide such variables. 1 indicate that the vendor can sell u that variable while 0 means that vendor doesn't have this variable.
- sameryNov 06, 2023Copper ContributorHi everyone
really hope to get your help so let's change the question differently.
based on the attached excel sheet, let's see I want to create one table for every vendor separately. It goes something like this:
Vendor 1 has 50 variables => this can be done via filter function of excel.
Vendor 2 has 40 variables on top of vendor 1 => this should be done again by filter function but must filter OUT variables already included in vendor 1
Vendor 3 offers 10 variables on top of vendor 1 and 2 again by filtering out already covered variables.
etc.. till end of vendor list. ==> this would conclude assessment of vendor 1
2nd separate table for Vendor 2 starts the same process and on an on...
So the first simple question: how do we use a filter function to filter from an array of 100 rows that have values 1 and filtering out already covered rows from previous rounds?- peiyezhuNov 06, 2023Bronze Contributorhow do we use a filter function to filter from an array of 100 rows that have values 1 and filtering out
Sorry,I can not get you by now.
If possible,can you upload an expected result workbook.based on the source dataset you have uploaded.- sameryNov 07, 2023Copper Contributor
You are right probably, I am complicating things.
Please redownload the file again and go to cell B235. The idea is to show what every vendor can provide and then the extra variables that the next vendor can provide above and beyond the variables provided by the previous providers. IS this now clear?