Multiplying from list, at changing rates

  • Hello


    I am having a problem with my coding and could greatly use some assistance.


    I am attempting to create code to search through one column of multiple numbers up to a certain value and then multiply these numbers by the values in the column next to the first column.


    In the attached document i am looking for a solution that would take the 'designated amount' value in H6 and then search through the 'Amount' column in the table until the value of H6 has been reached. Then the values in 'Amount' column need to be multiplied by the value in the 'Value' column of the table.

    Ideally, the solution would work in a way that if the 'designated amount' in H6 doesn't completely engulf one of the values in the 'Amount' column then it would take as many as needed to reach the value in H6 but no more.


    Many thanks

  • Hello,


    Why don't you take advantage of your test file ... to include ... not only the starting point ... but your expected result ...


    This would help clarify your process ...;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Hello again,


    Before diving into a macro ... would you mind checking your attached test file ...


    to validate my understanding ...:)

    Files

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • No problem ...


    Whenever you are modifying your " designated amount " in cell E2 ... do you get the correct "expected amount " in cell G2 ...?

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)