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
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Re: SUMIF, VLOOKUP (for currency conversion on various month

In B6 enter & copy down:

=SUMPRODUCT(--($B$12:$B$21=A6),$D$12:$D$21,LOOKUP($C$12:$C$21,$B$25:$C$27))

Note that A25:C27 must be sorted in ascending order on Curr column. Same for A28:C30. The above formula does not select itself whic one of these areas (that is, B25:C27 or B28:C30) to use.
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

Although I had to add an extra column (Concat), This seems to accommodate the several date/currency combinations in the lower chart. Hope this is of some help... /s/ Larry
Book2
ABCDE
1ReportReqd
2
3Formonth29-Feb-04
4
5CategoryEURGBPUSD
6Bank11954479927149346
7Property448858300106560758
8Funds149728100108187055
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
24DateCurrConcatRate
2529-Feb-04EUR38046EUR1
2629-Feb-04GBP38046GBP0.6686
2729-Feb-04USD38046USD1.2493
2831-Mar-04EUR38077EUR1
2931-Mar-04GBP38077GBP0.6814
3031-Mar-04USD38077USD1.3124
Sheet1
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

Tx, for the quick response Aldin and indiantrix. Aldin, your ingenius formula works and nearly does what I want, but there is an additional requirement which it omits...

What I would like is for the EUR balances to be calculated for the date entered in cell B3. So if 31-3-04 is entered in B3 the EUR balances for 31-3-04 are reflected and if 29-2-04 is entered it returns the values that your existing formula does. Is this possible? Reason why I ask is that I could be analysing any one month...

PS for my own education please explain the '--' in the formula you gave...the rest I can figure out.

indiantrix - your formula does not work, for example Property for 29/2/04 should be (350000+98858)*1.2493=EUR560758 (as Aldin formula calculates). Looks like it is just getting the absolute amount and not multiplying by the applicable exchange rate.

Many tx... :cool:
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

mikewray said:
...What I would like is for the EUR balances to be calculated for the date entered in cell B3. So if 31-3-04 is entered in B3 the EUR balances for 31-3-04 are reflected and if 29-2-04 is entered it returns the values that your existing formula does. Is this possible? Reason why I ask is that I could be analysing any one month...

You apparently missed the qualification I included in my original post:

"The above formula does not select itself whic one of these areas (that is, B25:C27 or B28:C30) to use."

But, as you wish...

=SUMPRODUCT(--($B$12:$B$21=$A6),INDEX($D$12:$E$21,0,MATCH(B$3,$D$11:$E$11,0)),LOOKUP($C$12:$C$21,INDEX($B$25:$B$30,MATCH($B$3,$A$25:$A$30,0)):INDEX($C$25:$C$30,MATCH($B$3,$A$25:$A$30,1))))

PS for my own education please explain the '--' in the formula you gave...the rest I can figure out...

It converts the logical values (TRUE and FALSE) into Excel's numeric equivalents 1 and 0, respectively. This "coercion" as it's called is required because SumProduct like most of functions requires numbers.
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

Yes, that works! But the actual spreadsheet I am working on has has 12 months across (Feb, Mar, Apr, May etc). Your formula (I knew it would have to have the index match which I still dont understand) only caters for Feb and March. I dont mind putting in more columns in the XRate table if necessary, just dont want more columns or rows anywhere else.

Tx you once again, we are nearly there I think...I really appreciate it.
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

mikewray said:
Yes, that works! But the actual spreadsheet I am working on has has 12 months across (Feb, Mar, Apr, May etc). Your formula (I knew it would have to have the index match which I still dont understand) only caters for Feb and March. I dont mind putting in more columns in the XRate table if necessary, just dont want more columns or rows anywhere else.
...

we are nearly there I think...

Not "we", you're nearly there...

Are you trying to tell me that you'll have 12 different dates in row 3 and corresponding data below so that the formula should be copiable across?
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

not to worry, figured it out, just needed to modify the references in your formula to include a larger range...all working sweetly. Not sure I understand it all (the index match bit gets me, any tips?) but will endeavour too as I think I will have applications for this else where. Many thanks....(y)
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

mikewray said:
not to worry, figured it out, just needed to modify the references in your formula to include a larger range...all working sweetly. Not sure I understand it all (the index match bit gets me, any tips?) but will endeavour too as I think I will have applications for this else where. Many thanks....(y)

In:

=SUMPRODUCT(--($B$12:$B$21=$A6),INDEX($D$12:$E$21,0,MATCH(B$3,$D$11:$E$11,0)),LOOKUP($C$12:$C$21,INDEX($B$25:$B$30,MATCH(B$3,$A$25:$A$30,0)):INDEX($C$25:$C$30,MATCH(B$3,$A$25:$A$30,1))))

the INDEX($D$12:$E$21,0,MATCH(B$3,$D$11:$E$11,0)) bit determines which subrange to pick out from D12:E21... All cells of the column computed by the MATCH bit from D12:E21. The MATCH bit returns here 1 or 2, depending on the date in B$3.

The LOOKUP($C$12:$C$21,INDEX($B$25:$B$30,MATCH(B$3,$A$25:$A$30,0)):INDEX($C$25:$C$30,MATCH(B$3,$A$25:$A$30,1))) bit looks up all values of C12:C21 in the subrange INDEX(...):INDEX(...). The first MATCH bit here determines where the subrange starts and the 2nd MATCH where the subrange ends.
 
Upvote 0
Re: SUMIF, VLOOKUP (for currency conversion on various month

Yes, I think I get it. The lookup bit could be simplified (?) if I created a key in the exchange rate table that concatanates the currency and the rate.

Right, bonne. Merci beaucoup!
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,294
Members
449,149
Latest member
mwdbActuary

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