Need to retrieve matching Date, Type, ID, and reference Cost based on user input Date Range. In Data Set 1 and Data Set 2 inputs are not sorted, and the match conditions need to look at if it falls within the Date Range first, check if the Type matches second, and if the IDs match third. If all (3) of these conditions pass it will list them in the Desired Output and pull the associated Cost. If the Cost occur on the same date, it will add them together. Prefer an Excel 2019 formula-based approach over VBA.
| Data Set 1 | Data Set 2 | Date Range | Example of Desired Output | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Date | Type | ID | Cost | Date | Type | ID | Cost | 1/1/25 | 2/28/25 | Date | Type | ID | Cost |
| 2/18/25 | Apple | 123 | $5 | 2/18/25 | Apple | 456 | $30 | User Input | 1/16/25 | Banana | 104 | $75 | |
| 2/21/25 | Pear | 102 | $10 | 1/29/25 | Pear | 789 | $35 | 1/28/25 | Pear | 789 | $15 | ||
| 1/28/25 | Pear | 789 | $15 | 1/28/25 | Mango | 852 | $40 | 1/29/25 | Pear | 789 | $35 | ||
| 2/8/25 | Apple | 879 | $20 | 2/8/25 | Apple | 123 | $45 | 2/8/25 | Apple | 123 | $45 | ||
| 1/16/25 | Banana | 104 | $25 | 1/16/25 | Banana | 104 | $50 | 2/18/25 | Apple | 123 | $5 | ||
| 7/5/25 | Berry | 222 | $45 | 10/8/25 | Berry | 145 | $8 | ||||||
| 8/5/25 | Melon | 456 | $13 | 5/4/25 | Melon | 654 | $45 | ||||||
| 3/8/25 | Kiwi | 852 | $18 | 6/9/25 | Kiwi | 321 | $15 |


FILTER? I might just buy excel 2021 just for that feature.