SUMIF, VLOOKUP (for currency conversion on various months)

mikewray

New Member
Joined
Apr 23, 2004
Messages
36
Frustrated and cannot get this, no matter which way I try. What formula will give me the EUR amounts for any given month (from cell B3)? See table below...

I dont want to create any more columns etc, I know the long way round...I am looking for an elegant solution. Is sumif, vlookup possible to combine or do I have to use sumif, index, match which I dont really understand. Problem illustrated below, first part is what I want and below is the source data (balances per month in base currency and xchange rate table):
CFFC 0403 v1.xls
ABCDE
1ReportReqd
2
3Formonth29-Feb-04
4
5CategoryEUR
6Bankformula?
7Propertyformula?
8Fundsformula?
9
10Data
11CompanyCategoryCurrency29-Feb-0431-Mar-04
12FPGBankGBP18,87310,255
13CIOBankGBP34,74816,348
14YTRBankUSD2,654(6,029)
15FPGBankGBP2,2327,033
16CIOBankEUR47,28618,886
17YTRBankGBP13,75114,237
18FPGPropertyUSD350,000350,000
19FPGFundsEUR29,43531,234
20FPGPropertyUSD98,858102,345
21YTRFundsGBP120,293138,907
22
23XCRates
24DateCurrRate
2529-Feb-04EUR1.0000
2629-Feb-04GBP0.6686
2729-Feb-04USD1.2493
2831-Mar-04EUR1.0000
2931-Mar-04GBP0.6814
3031-Mar-04USD1.3124
for mr excel
 
Re: SUMIF, VLOOKUP (for currency conversion on various month

Requirement 1 (closing bal for Cash at 31-3-04) control answer is correct, calculated as follows:

Acct 10 (Cash) = closing Mar bal = GBP18518.08 x 1.49 = EUR27591.94
Acct 20 (Cash) = closing Mar bal = (USD8263.46) x 0.82 = (EUR6776.04)
Acct 40 (Cash) = closing Mar bal = USD18872.76 x 0.82 = EUR15475.66

The total is EUR36291.57. Ah, this is just a rounding error. I had formatted the numbers in my example and did not realise the true value did not carry to the HTML). So I think you got it. Pray tell master, how did you do it?

The difference between the two requirements:
---------------------------------------------------
The first requirement is the closing balance (sum of all transactions to date) of a category at the closing rate.

The second requirement is the movements (transactions) in a particular month for a specified category valued at the exchange rate applicable for that month. So the two are different. It is easy to see for Feb Equity IS, there was only one transaction in Feb, the dividends recd of GBP332 at a rate of 1.52 = EUR504.64

Other than my usual thank yous, how do I make a meaningful contribution to this medium. It is great...
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Re: SUMIF, VLOOKUP (for currency conversion on various month

mikewray said:
Requirement 1 (closing bal for Cash at 31-3-04) control answer is correct, calculated as follows:

Acct 10 (Cash) = closing Mar bal = GBP18518.08 x 1.49 = EUR27591.94
Acct 20 (Cash) = closing Mar bal = (USD8263.46) x 0.82 = (EUR6776.04)
Acct 40 (Cash) = closing Mar bal = USD18872.76 x 0.82 = EUR15475.66

The total is EUR36291.57. Ah, this is just a rounding error. I had formatted the numbers in my example and did not realise the true value did not carry to the HTML). So I think you got it. Pray tell master, how did you do it?

The difference between the two requirements:
---------------------------------------------------
The first requirement is the closing balance (sum of all transactions to date) of a category at the closing rate.

The second requirement is the movements (transactions) in a particular month for a specified category valued at the exchange rate applicable for that month. So the two are different. It is easy to see for Feb Equity IS, there was only one transaction in Feb, the dividends recd of GBP332 at a rate of 1.52 = EUR504.64

Other than my usual thank yous, how do I make a meaningful contribution to this medium. It is great...
mikewray.xls
ABCDEFGH
1DATA
2AcctDateCmpyCategoryCurrDescriptionAmountAssign
31029-Feb-04BALCashGBPOpeningbal29/2/0418873BS
41015-Mar-04BALCashGBPPymtOMCinvoices-332IS
51031-Mar-04BALCashGBPBankcharges-22IS
62015-Mar-04BALCashUSDPymtLARinvoice021/2004-8382IS
72031-Mar-04BALCashUSDInterest1Q04119IS
83024-Feb-04HFCEquityGBPOpeningbal29/2/0434748BS
93025-Feb-04HFCEquityGBPDividends332IS
103029-Feb-04HFCEquityGBPPurchases-2220BS
114029-Feb-04BALCashUSDOpeningbal29/2/0418873BS
12
13XchangeratestoEUR
14PeriodCurrRate
1529-Feb-04GBP1.52
1629-Feb-04USD0.8004
1731-Mar-04GBP1.49
1831-Mar-04USD0.82
19
20REQUIREMENTS
21Required1Required2
22Enterdate31-Mar-04Enterdate29-Feb-04
23EnterCategoryCashEnterCategoryEquity
24BalinEUR36293.51ISmvmt(EUR)formonth504.64
Sheet2


Formulas...

D24:

=SUMPRODUCT(--($D$3:$D$11=D23),--($B$3:$B$11<=D22),$G$3:$G$11,LOOKUP($E$3:$E$11,INDEX($B$15:$B$18,MATCH($D$22,$A$15:$A$18,0)):INDEX($C$15:$C$18,MATCH(D22,$A$15:$A$18,1))))

G24:

=SUMPRODUCT(--($D$3:$D$11=G23),--(MONTH($B$3:$B$11)=MONTH(G22)),--(YEAR($B$3:$B$11)=YEAR(G22)),--($H$3:$H$11="IS"),$G$3:$G$11,LOOKUP($E$3:$E$11,INDEX($B$15:$B$18,MATCH(G22,$A$15:$A$18,0)):INDEX($C$15:$C$18,MATCH(G22,$A$15:$A$18,1))))
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

Exactly...just as as I thought :eek: so easy this stuff for you isn't it. Well done, thanks. I really want to get this but I cannot get my head around it and I normally can with this stuff. I get quite a lot of it...the first few bits with the "--" are the criteria being specified, the next is the range where the numbers it should add for those which match the criteria and the last bit is the lookup of the exchange rate.

Questions:
Why are all the arguments seperated by commas - does the comma donate a multiplication or what does it mean. How does it know to add the values in the specified range and then multiply by the appropriate exchange rate, or is it doing it one by one? A normal sumproduct uses the * to seperate the different criteria.

I thought index function was index(array, col, row)...in your index function you have more, or less, depends if you count before after the colon. I suppose explaining the colon will answer this.

I would really like to be able to write this formula fresh but first I need to understand how it is actually performing the math and the syntax that tells it to do it as such. If you dont have time that is ok but I really want to get this and it is killing me not knowing...

Many thanks, Michael
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,393
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