Multiply & sum of numbers and the equivalents of datas (Array sum in array)

McExcel

New Member
Joined
Sep 9, 2014
Messages
14
Hi everyone! First post ! Sorry for the title :D My English is not excellent so I show my problem on an example:


A3,13equivalents
C2,62A1
C4,12B2
F10,13C3
D83,2D4
E5
F6
Question: How can multiply Equivalents of A,B,C... in one step?
A*3,13 + C*2,62 + C*4,12 + F*10,13 + D*83,2

<tbody>
</tbody>

The answer should be:120,2 sorry 416,93


I've tried vlookup and with array formulas using (control+shift+enter). But I couldn't solve.

For example:

={SUM(VLOOKUP(A1:A5,equivalents,2,false),B1:B5)} .... not working
 
Last edited by a moderator:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I really like the "exotic" solution like as Aladin's rat-run. I always test and try to understand how works.

Now, last and little request: How can we add if statement to the same problem?

For example

A3,13AVAILABLE
equivalents
C2,62A1
C4,12AVAILABLE
B2
F10,13C3
D83,2AVAILABLE
D4
E5
F6
Question: How can multiply Equivalents of A,B,C... in one step according to available status?
A*3,13 + C*4,12 + D*83,2

<tbody>
</tbody>



The answer should be 348.29
 
Last edited:
Upvote 0
I really like the "exotic" solution like as Aladin's rat-run. I always test and try to understand how works.

:cool: but no need worrying the exotic...

Now, last and little request: How can we add if statement to the same problem?

...

=SUMPRODUCT(SUMIFS($E$2:$E$7,$D$2:$D$7,$A$1:$A$5,$C$2:$C$7,"AVAILABLE")*$B$1:$B$5)
 
Last edited:
Upvote 0
:cool: but no need worrying the exotic...



=SUMPRODUCT(SUMIFS($E$2:$E$7,$D$2:$D$7,$A$1:$A$5,$C$2:$C$7,"AVAILABLE")*$B$1:$B$5)

Dear Aladin

Works but the results were false. I need
A1*B1 if C1 has "AVAILABLE" + A2*B2 if C2 has "AVAILABLE" +... + so on...

By the way
A1 has "A" value and means 1
A2 has "C" value and means 3
A3 has "C" value and means 3
... so on
 
Upvote 0
Dear Aladin

Works but the results were false. I need
A1*B1 if C1 has "AVAILABLE" + A2*B2 if C2 has "AVAILABLE" +... + so on...

By the way
A1 has "A" value and means 1
A2 has "C" value and means 3
A3 has "C" value and means 3
... so on

Is the expected result not 332.80? Please check this manually.
 
Upvote 0
Your formula gives the 332.80.

But I need like that:
1 * 3.13 = 3.13​
3 * 4.12 = 12.36​
4 * 83.2 = 332.80
+___________________
348.29

Right.

Control+shift+enter, not just enter:

=SUM(SUMIF($D$2:$D$7,IF(C1:C5="available",$A$1:$A$5),$E$2:$E$7)*$B$1:$B$5)
 
Upvote 0
Right.

Control+shift+enter, not just enter:

=SUM(SUMIF($D$2:$D$7,IF(C1:C5="available",$A$1:$A$5),$E$2:$E$7)*$B$1:$B$5)

Dear Aladin,

I've used with a data (10k rows) and it works like a charm !

Today you're very very helpful. The solutions are not as very hard as I thought. I will examine all formulas after finishing my current job.

Also, I really need the fundamentals of array functions, then I should put the questions to experts. Thanks for your patience :)
 
Upvote 0
Dear Aladin,

I've used with a data (10k rows) and it works like a charm !

Today you're very very helpful. The solutions are not as very hard as I thought. I will examine all formulas after finishing my current job.

Also, I really need the fundamentals of array functions, then I should put the questions to experts. Thanks for your patience :)

You are welcome. Thanks for providing feedback.
 
Upvote 0
Exotic formula....continued...hehehe:LOL:

=SUM(IFERROR(INDEX($E$2:$E$7,N(CHOOSE(1,IF($C$1:$C$5="available",MATCH($A$1:$A$5,$D$2:$D$7,0),999999)))),0)*B1:B5)

It works, of course, but Aladin's formula is better (y)

Regards
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,395
Members
449,446
Latest member
CodeCybear

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top