Reputation: 4125
This is my sheet:
Goods Type Quantity / Geram Gold Price 750K Price of Exchange
Gold 100 1,554.00 0
Silver 500 235.00 0
Euro 200 0.00 1.01
Pond 50 0.00 0.97
Gold 100 1,554.00 0
Silver 500 235.00 0
Euro 200 0.00 1.00
Pond 50 0.00 0.99
I want to do to this:
If Goods Type
is Gold
: multiply Quantity / Geram
by Gold Price
.
In my case it should be: (100 * 1554) + (100 * 1554)
= 310800
, and if I add more entries in the future, it should add more.
I have this cell in my current sheet: If Goods Type
is Gold
, then sumif
all Quantity / Geram
in another cell which is now 200
.
Upvotes: 0
Views: 104
Reputation: 17551
You can make a SumProduct()
for three columns, so you can create an IF()
formula for getting 1 in case of "Gold" and 0 else. This leads to following kind of formula:
=SUMPRODUCT(IF(A2:A6="Gold",1,0),B2:B6,C2:C6)
See following screenshot:
Upvotes: 2
Reputation: 5501
Use SUMPRODUCT
: sumproduct
=SUMPRODUCT((A2:A9="Gold")*B2:B9*C2:C9)
It multiplies TRUE/FALSE (result of A2:A9="Gold"
) with quantity and price and sums everything (in this case = 155400 + 0 + 0 + 0 + 15540 + 0 + 0 + 0))
Result:
Adjust ranges to your data.
Upvotes: 2