PDA

View Full Version : VBA Macro FUNCTION To Sum Up Values of multiplier of muti-Columns



tungtran.ftu
05-13-2015, 09:31 PM
Dear everyone.

I have to create a new function that sum of multiplier of muti-columns like below
A B C D E F G H
Qty' Price Qty' Price Qty' Price Total
Code1: 20 5 15 6 21 5.2 =Sum(B3*C3+D3*E3+F3*G3) -> function for this fomula
Code1: 20 5 15 6 21 5.2 =Sum(B4*C4+D4*E4+F4*G4)
Code1: 20 5 15 6 21 5.2 =Sum(B5*C5+D5*E5+F5*G5)
Code1: 20 5 15 6 21 5.2 =Sum(B6*C6+D6*E6+F6*G6)
Who can help me solve it?
Many thanks to you.

tungtran.ftu
05-13-2015, 09:55 PM
Solved.

mancubus
05-14-2015, 12:00 AM
welcome to VBAX tungtran.ftu

it's a good practice to share the solution for other users who may need it in the future.

another good habit is to mark the thread as solved from thread tools (topright corner of the page, above the first mesage).

mancubus
05-14-2015, 12:41 AM
anyway...

=SUM(B3*C3,D3*E3,F3*G3)

or
=B3*C3+D3*E3+F3*G3

or
=SUMPRODUCT(CHOOSE({1;2;3},B3,D3,F3);CHOOSE({1;2;3},C3,E3,G3))