find product of 2 cells and a match index in a row, then sum the result

dalexcel

New Member
Joined
Feb 25, 2016
Messages
1
I would like to find the Sum of the No. Units*price*relevant exchange rate according to month and currency.

Here is my two sets of data:
1. Info
ABCD
DateCurrencyNo UnitUnit Price
105/JanEUR1001.15
207 JanUSD10020
309 FebHKD200100
410 MarEUR3004
528 MarUSD7009

<tbody>
</tbody>


2. Exchange rate matrix (Range named FX)

ABCD
1JanFebMar
2EUR1.11.21.3
3HKD0.130.140.15
4USD111

<tbody>
</tbody>


Essentially what I would like to find is one formula to Sum the products from column C, D, and the index match according to FX the range.

In other words

(C1*D1*Indexmatch to find exchange rate according to A1 and B2)+(C2*D2*Indexmatch to find exchange rate according to A2 and B2) etc......

I would like to avoid adding a column that finds the product for each row. Hence I'm asking for a formula to sum all info at once.
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,238
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
try this

<b>Excel 2012</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Date</td><td style=";">Currency</td><td style=";">No Unit</td><td style=";">Unit Price</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">05-Jan</td><td style=";">EUR</td><td style="text-align: right;;">100</td><td style="text-align: right;;">1.15</td><td style="text-align: right;;">126.5</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">07-Jan</td><td style=";">USD</td><td style="text-align: right;;">100</td><td style="text-align: right;;">20</td><td style="text-align: right;;">2000</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">09-Feb</td><td style=";">HKD</td><td style="text-align: right;;">200</td><td style="text-align: right;;">100</td><td style="text-align: right;;">2800</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">10-Mar</td><td style=";">EUR</td><td style="text-align: right;;">300</td><td style="text-align: right;;">4</td><td style="text-align: right;;">1560</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">28-Mar</td><td style=";">USD</td><td style="text-align: right;;">700</td><td style="text-align: right;;">9</td><td style="text-align: right;;">6300</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: right;;"></td><td style=";">Jan</td><td style=";">Feb</td><td style=";">Mar</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">EUR</td><td style="text-align: right;;">1.1</td><td style="text-align: right;;">1.2</td><td style="text-align: right;;">1.3</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">HKD</td><td style="text-align: right;;">0.13</td><td style="text-align: right;;">0.14</td><td style="text-align: right;;">0.15</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">USD</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet5</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">E2</th><td style="text-align:left">=INDEX(<font color="Blue">$B$9:$D$11,MATCH(<font color="Red">$B2,$A$9:$A$11,0</font>),MATCH(<font color="Red">TEXT(<font color="Green">$A2,"mmm"</font>),$B$8:$D$8,0</font>)</font>)*C2*D2</td></tr></tbody></table></td></tr></table><br />
 

radian89

Board Regular
Joined
Nov 12, 2015
Messages
111
Hi Dalexcel,

what you looking for gonna generate very long formula. adding 1 column certainly make it short. take a look at this.

change your month with number, 1, 2, 3, to make the formula work.

exchange rate will use index & match.
the total will use sumproduct.

but if you want to combine it all then the formula will be

D4*E4*INDEX($C$16:$E$18,MATCH(C4,$B$16:$B$18,0),MATCH(MONTH(B4),$C$15:$E$15,0)) +
D5*E5*INDEX($C$16:$E$18,MATCH(C5,$B$16:$B$18,0),MATCH(MONTH(B5),$C$15:$E$15,0)) +
.
.
.
.



2dcahic.jpg
[/IMG]
 

Watch MrExcel Video

Forum statistics

Threads
1,122,652
Messages
5,597,373
Members
414,139
Latest member
okela0

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
Top