# Combination of numbers from that set will sum to the total

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:19 PM GMT

## Question

it is possible for VBA/formula do the calculation ? if can, how?

Assume Given a set of random numbers and a total,and VBA will calculate what combination of numbers from that set will sum to the total

e.g) A_no + B_no + c_no + d_no = total

VBA and formula both can calculate numbers.

In formula, you can see the calculation. If you have A_no in cell a1 B_no cell a2 and c_no in a3 and d_no in cell a4, then a formula like these in a5 will add all them up:

=a1+a2+a3+a4

or

=sum(a1:a4)

In VBA, all you do is declare variables, assign values using the cell positions and add the formula between lines of code to do the sum.

Mark

## Question

it is possible for VBA/formula do the calculation ?

Assume Given a set of random numbers and a total,and VBA will calculate what combination of numbers from that set will sum to the total

e.g) A_no + B_no + c_no + d_no = total