Excel formula, only Genius Masters may solve: very challenging Foreign Exchange rate convertion using FIFO Method

jamilm

Well-known Member
Joined
Jul 21, 2011
Messages
740
Geniuses, Masters and Gurus of Excel.

i have a very challenging situation with Excel and beating my brain against the wall. but still failed to accomplish.

I have small project, where i receive the fund from a client/company in EURO however my financial system and bank account is in USD and whatever fund i receive in EURO, it converts using that days foriegn exchange rate of the bank. so this part is easy, i can get the exchange rate from my bank statement. All of the project expenses are in USD but based on my agreement with my client, i have to report back the expenses in EURO currency, converting all USD expenses back to EURO using prevailing foreign currency exchange rate at the date of receipt of funds in my bank. Now the method to convert the expense USD to EURO based on the foreign currency exchange rate at the date of receipt of funds Must be in (FIFO) method "First In, First Out"

I have put a detail workout breakdown of the calculation in the uploaded workbook. if anything is unclear, please let me know, so that i provide further elaboration on the question.

I would really appreciate any help on this challenging situation and this will save hours of my time.




file uploaded https://app.box.com/s/zmkzsqo8eg4l684zwi1z



Excel 2010
ABCDEFGHIJKLMNOPQRSTUVWXY
1DateDeposits Income in EUROConverted deposit income in USDExchange rate based on the rate as of fund receipt dateManual Workings texts
25/1/2010€ 910,215.00$ 1,191,380.890.764
39/18/2012€ 982,713.00$ 1,204,305.150.816Now since our first deposit converted USD was 1,191,380,89, we can convert our expenses to EURO using 0.764 rate up to this amount 1,191,380.89
41/12/2013€ 287,674.10$ 368,288.380.781once we finish convertion of expense amount up to this limit then we have to move to the next exchange rate . See calculation below
5Total€ 2,180,602.10$ 2,763,974.42
6
7$ 575,001.55USD balance of first deposit after converstion of 576,140.01 & 40,239.33 ubB10 and B11
8$ 694,525.51since the USD 1,269,527.06 is greater than available balance from first deposit , we need to convert the expense from the second deposit
9DateExpense in USDConvert to EURO based on the exchange rate of receipt of fund using FIFO method€ 439,301.18EURO converted using the first deposit exch rate
102/2/2011$ 576,140.01€ 440,170.97€ 566,732.81EURO converted using the second deposit exch rate
112/17/2011$ 40,239.33€ 30,742.85$ 509,779.64USD Balance from the second deposit after converstion of 694,525.51
128/22/2012$ 1,269,527.06€ 1,006,034.00Now since the B13 value of USD 88,866.93 is lower than the balance from the second deposit then we can use again the second deposit exch rate to convert
1310/1/2012$ 88,866.93€ 72,515.41$ 420,912.71USD is the balance left after another convertion of expense 88,866.93 was deducted
141/18/2013730,345.13€ 585,165.84Now, we want to convert USD 730,345.13 and our balance from the second deposit which is 420,912.71 cannot suffice, we will split the convertion between second deposit and third deposit exchange rates
153/9/2013$ 50,145.00€ 39,168.81€ 343,464.77EURO converted using the second deposit exch rate
16Total$ 2,755,263.46€ 2,173,797.88$ 309,432.42this is the remaining USD expense to conver using third deposit exchange rate
17€ 241,701.07EURO converted using the third deposit exch rate
18$ 58,855.96USD balance left from the third deposit
19now we want to convert the last item in B15 and since this is within the available balance from third deposit we simply convert it using the third deposit exchange rate
20AS YOU CAN SEE, I AM DOING ALL THESE CONVERTIONS USING MANUAL HECTIC MANUAL MATH OPERATIONS
21I NEED A FORMULA TO PUT IN RANGE C10:C15 SO THAT IT GIVES ME THE SAME RESULT WITH THE POWER OF FORMULA INSTEAD OF THIS MANUAL CALCULATION
22I WOULD GREATLY APPRECIATE ANY HELP
23
24
Sheet1
Cell Formulas
RangeFormula
D2=B2/C2
D3=B3/C3
D4=B4/C4
B5=SUBTOTAL(109,Sheet1!$B$2:$B$4)
B16=SUBTOTAL(109,Sheet1!$B$10:$B$15)
C5=SUBTOTAL(109,Sheet1!$C$2:$C$4)
C10=B10*D2
C11=B11*D2
C12=F9+F10
C13=B13*D3
C14=F17+F15
C15=B15*D4
C16=SUBTOTAL(109,Sheet1!$C$10:$C$15)
F7=C2-(B10+B11)
F8=B12-F7
F9=F7*D2
F10=F8*D3
F11=C3-F8
F13=F11-B13
F15=F13*D3
F16=B14-F13
F17=F16*D4
F18=C4-F16
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Maybe this can work...(not fully tested, but seems to work)


A
B
C
D
E
F
G
1
Date​
Euros​
Dollars​
Rate​
Cumulative​
Diff Rate​
2
05/01/2010​
910.215,00​
1.191.380,89​
0,764​
0,00​
0,764​
3
09/18/2012​
982.713,00​
1.204.305,15​
0,816​
1.191.380,89​
0,052​
4
01/12/2013​
287.674,10​
368.288,38​
0,781​
2.395.686,04​
-0,035​
5
Total​
2.180.602,10​
2.763.974,42​
6
7
8
9
Date​
Espenses USD​
Euros​
10
02/02/2011​
576.140,01​
440.170,97​
11
02/17/2011​
40.239,33​
30.742,85​
12
08/22/2012​
1.269.527,06​
1.006.034,00​
13
10/01/2012​
88.866,93​
72.515,41​
14
01/18/2013​
730.345,13​
585.165,83​
15
03/09/2013​
50.145,00​
39.168,81​
16
Total​
2.755.263,46​
2.173.797,87​

Formula in F2 copied down till F4
=SUM(C$1:C1)

Formula in G2 copied down till G4
=D2-N(D1)

Formula in C10 copied down till C15
=SUMPRODUCT(--(SUM(B$10:B10)>$F$2:$F$4),SUM(B$10:B10)-$F$2:$F$4,$G$2:$G$4)-SUM(C$9:C9)

Formula in C16
=SUM(C10:C15)

Hope this helps

M.
 
Upvote 0
Marcelo,


your formula popped my eyes. it is truly mind blowing! thank you very much. this is really genius's work.


it worked perfectly even more precise than manual calculation. I am rating thread a 5 star.


by the way, i still have your bottle of champagne; it is now, one more year old :) waiting to see you and to hear sound from the pop of the cork from this bottle of champagne.

i was wondering is there a possibility not to use the helper columns and somehow incorporate the F2 and G2 formulas inside the formula in C10 to C15? i mean just a thought. otherwise no problem, the one you provided has already done the work and is great formula.

a big like to this post.

best regards,
jamilm


Maybe this can work...(not fully tested, but seems to work)


Formula in F2 copied down till F4
=SUM(C$1:C1)

Formula in G2 copied down till G4
=D2-N(D1)

Formula in C10 copied down till C15
=SUMPRODUCT(--(SUM(B$10:B10)>$F$2:$F$4),SUM(B$10:B10)-$F$2:$F$4,$G$2:$G$4)-SUM(C$9:C9)

Formula in C16
=SUM(C10:C15)

Hope this helps

M.
 
Upvote 0
Great, that formula worked. Happy to help.

I did not forget the bottle of champagne. Keep it fondly! :)

Regards,

M.
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,699
Members
449,117
Latest member
Aaagu

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