Solved

Find out which units in a list equal a certain amount

Posted on 2012-03-16
2
191 Views
Last Modified: 2012-03-16
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
0
Comment
Question by:kpyrgos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 37728322
Enter Table A in A3:A6
Enter Table B in B2:F2 and in "Descending order"
Enter this formula in B3
=INT(($A3-SUMPRODUCT(--$A$2:A$2,--$A3:A3))/B$2)
copy this formula down and across
0
 

Author Comment

by:kpyrgos
ID: 37728346
Thank you sir!!

I never knew sumproduct could be used with "--".
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question