Working on a OFFSET MATCH formula to return a unique list of values based on a reference cell.
The lookup value cell will have a one word value i.e. Cream
This formula works exactly how I need it to for exact matches
= OFFSET(PRODUCT,MATCH($E$21,PRODUCT_MIX,0)-1,0,COUNTIF(PRODUCT_MIX,$E$21), 1)
But Cream may appear in the lookup array as Cream or Ice Cream or Ice Cream Cone .. etc can appear as either single value or anywhere within a text string or comma separated text so I need the formula to include wild card ""&$E$21&""
Reference and look up array etc are named ranges
We have spent a huge amount of time researching and testing to get this right, we almost have it working but now stuck. Would appreciate if anyone can point us in the right direction
When the wildcard is added the formula is returning the correct number of results BUT its not returning the actual correct results.
= OFFSET(PRODUCT,MATCH("*"&$E$21&"*",PRODUCT_MIX,0)-1,0,COUNTIF(PRODUCT_MIX,"*"&$E$21&"*"), 1)
Example, if the correct number of results should be 4 this formula is returning the first 4 values in the column instead of the correct 4 values
Example data
PRODUCT_MIX | PRODUCT |
---|---|
Cream | Thickened Cream |
Milk, Cream, Eggs | Scrambled Eggs |
Cheese, Crackers, Olives | Antipasto |
Ice, Cream | Vanilla Ice Cream |
Ice, Cream, Cone | Ice Cream Cone |
Milk, Milo | Chocolate Milk |
If Cream was selected, I want the result to be a list containing Thickened Cream, Scrambled Eggs, Vanilla Ice Cream, Ice Cream Cone.
But the current formula is returning the following list instead, Thickened Cream, Scrambled Eggs, Antipasto, Vanilla Ice Cream
See below, Cream is selected in yellow and the formula is returning the incorrect results
Any help would be appreciated
I'll post this in case it is helpful. It's the closest I have been able to get but I can't figure out how to squeeze the empty cells out. I might have some more time to look at this later on.
P.S. You could accomplish the same goal with one line (Range.AdvancedCopy) in VBA.