Avatar of kpyrgos
kpyrgos
 asked on

Find out which units in a list equal a certain amount

Hello experts,

I want to buy some assets listed below in Table A

Table A
 12,40  
 12,60  
 14,10  
 14,70  

I can buy those assets with the values from Table B

Table B
 0,10  
 0,20  
 0,50  
 1,00  
 2,00  

I would like a formula or vba code that can calculate the way i can do it

e.g.

Table A      Solution
 12,40          6x2,00 - 2x0,20
 12,60          6x2,00 - 3x0,20
 14,10          7x2,00 - 1x0,1
 14,70          7x2,00 - 1x0,50 - 1x0,20


For the first asset i would need six of two and two of 0,2 and so on..


Thanks in advance
Microsoft Excel

Avatar of undefined
Last Comment
kpyrgos

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
kpyrgos

ASKER
Thank you sir!!

I never knew sumproduct could be used with "--".
Your help has saved me hundreds of hours of internet surfing.
fblack61