The following works for the Truck:Seat example in rows 5:12
Formula:
=IF(ISNUMBER(SEARCH(B4,B5)),PRODUCT(J4,D5),D5)
The following works for the Chair:Rivets example in rows 19:23
Formula:
=IF(LEN(B19)=1,PRODUCT(D19,IFERROR(INDEX(D$18:D18,AGGREGATE(14,6,(ROW(D$18:D18)-ROW(D$17))/(LEN(B$18:B18)=1),1)),1)),PRODUCT(D19,J18))
I don't know how you would tell Excel that there is a difference between a Chair and a Truck however.
My feeling is that if you want one formula for both scenarios, you may have to manually put the number of seats that would be needed for two chairs in the second example. You could then use the first formula for both as modeled in rows 26:30
Let us know if you have any questions.
Bookmarks