I have an excel sheet with multiple dropdown selection, where items are binded with master data in sheet 2. Master data contains items and their respective values. Now I am using a formula for sum of items selected in the dropdown list as below
=SUMPRODUCT(ISNUMBER(SEARCH(PRODUCT,J4))*AMOUNT)
where PRODUCT & AMOUNT is master data and J4 is column reference of multiple selection dropdown list. Code works well but whenever I select duplicate item in dropdown list the amount of duplicate item is not reflected in the SUM column where the code is addedd. However the count of items selected works well with below formula
=IF(J4="","",(LEN(J4)-LEN(SUBSTITUTE(J4,CHAR(10),""))+1))
Data:
| PRODUCT | AMOUNT |
|---------|--------|
| Apple | 100 |
| Grapes | 200 |
| Orange | 50 |
| Mango | 500 |
| Guava | 350 |
| Cherry | 170 |
Expected result:
It's multiple selection dropdown. In second row I have selected Apple, Grapes & Orange so it counts 350 (100 + 200 + 50). Now in 1st row if I select Apple again then the cost of apple should be added in sum i.e. it should be 450 (100 + 200 + 50 + 100)