Forum Discussion
Handiman
Mar 28, 2021Copper Contributor
How to calculate multiple item dropdown list
I have a monthly invoice list of purchases. I have a multiple item dropdown list in an abbreviated form. (Menu & Price List) I need to have the short item name equal to an amount. Then in the led...
HansVogelaar
Mar 29, 2021MVP
Here is a custom function you can use:
Function Total(Items As String, PriceList As Range) As Double
Dim a() As String
Dim i As Long
Dim t As Double
a = Split(Items, ", ")
For i = LBound(a) To UBound(a)
t = t + Application.VLookup(a(i), PriceList, 2, False)
Next i
Total = t
End Function
Use like this in C4:
=Total(B4,'Menu & Price List'!$B$2:$C$18)
Fill down.
See the attached version.