Data Comparison Matrix

rockandahardplace

New Member
Joined
Jan 22, 2011
Messages
6
Hello,

I have searched high and low on this fabulous forum for the last day trying to find a solution to my problem . But alas I couldn't find the exact right fit for what I need to do...

I have two sets of data. They are in separate worksheets and arranged within their respective sheets by row. Column A in both sheets houses the headings/titles. In Sheet 1 you see the drink names and if you read across have an idea how to assemble the ****tails:
Excel Workbook
ABCDEFGH
1Cosmovodkacranberrytriple seclime
2Mojitorummintlimesugarsoda
3Long Islandvodkatequilarumgintriple secsweet & sourcoca cola
4Gin & Tonicgintoniclime
5Cape Codcranberryvodka
6Blood Maryvodkatomatohot sauceworcestershirelemonsaltcelery
Sheet1
Excel 2010

The second sheet is just 'random' combinations of products:
Excel Workbook
ABCDE
1Combo 1vodkalemonrum
2Combo 2lemonlimesodasugar
3Combo 3tequilalime
4Combo 4tomato juicevodkacelery
5Combo 5mintvodka
6Combo 6mintrum
7Combo 7cranberryvodka
8Combo 8midoritriple sec
9Combo 9whiskeyorangebitters
Sheet2
Excel 2010

I need to find out if the entire contents of one row (e.g., Combo 7) of Sheet 2 fit into a recipe from Sheet 1. In my example Combo 7 (vodka & cranberry) are two elements found in both the Cosmo and Cape Cod. It's not required that all of the ingredients be listed. Most of the posts I have seen compare individual items in a list against other individual items. I need to treat these as a block. Ideally, the output would be in a separate worksheet and generate a matrix something like the following with 1s and 0s for true and false:
Excel Workbook
ABCDEFG
1CosmoMojitoLong IslandGin & TonicCape CodBlood Mary
2Combo 1000000
3Combo 2000000
4Combo 3000000
5Combo 4000001
6Combo 5100000
7Combo 6010000
8Combo 7100010
9Combo 8000000
10Combo 9000000
Sheet3
Excel 2010

Hopefully, this challenge will entice some of the programming experts to give this some attention. I appreciate in advance any guidance that you are able to provide. Thanks!!!
 
The formula in G1 and G10 seem to be proper.

One thing I forgot to mention, you need to ensure that there are no extra spaces in any of the cells. I seem to recall that when I had initially copied over your data (from Post 1), the "Cranberry" from Sheet2 had an extra space after it.
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Sandeep,

I am on my knees praising you. Thank you very much. Your solution worked flawlessly. Darn those extra spaces (that aren't entirely visible). Once I removed them the matrix looked beautiful.

Quick follow up question and then go enjoy your weekend. If I want to use this formula for a much larger data set are there any adjustments that need to be made to the parent formula? Sheet 2 of my real data has a minimum of 100 rows but a maximum of 9 columns. Sheet 1 is similar with a minimum of 100 rows and up to 26 columns.

Thanks!!!
 
Upvote 0
You're welcome! I'm glad it worked fine.

For the actual data, you can extend the ranges, but as before ensure that the absolute and relative referencing are proper i.e. the $ signs.

The formula should behave in the same way i.e. across columns only the column name should change in the last parenthesis, and down rows only the row number should change in the second parenthesis.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top