0

Given the following columns, where A is the currency and B is a monetary value in that currency:

A B
USD 50
USD 150
EUR 200
EUR -150
AUD 300

How can I use the GOOGLEFINANCE function to return the sum the of entire value of column B in another given currency (for example, GBP)?

Any advice appreciated.

Thanks

player0
  • 124,011
  • 12
  • 67
  • 124
Dan
  • 6,265
  • 8
  • 40
  • 56
  • Maybe `=B1*GOOGLEFINANCE("CURRENCY:"&A1&"GBP")` and drag down. I don't think it would be possible in a neat looking arrayformula to get a direct `SUM()` unless it will probably look terrible. Maybe some script of some sort. – JvdV Feb 17 '21 at 10:23

1 Answers1

0

GOOGLEFINANCE is not supported under ARRAYFORMULA so you either introduce helper column with dragable formula:

=B2*GOOGLEFINANCE("CURRENCY:"&A2&"GBP")

enter image description here

and then sum it:

=SUM(D2:D)

0

or you can construct array:

=SUM({
 B2*GOOGLEFINANCE("CURRENCY:"&A2&"GBP");
 B3*GOOGLEFINANCE("CURRENCY:"&A3&"GBP");
 B4*GOOGLEFINANCE("CURRENCY:"&A4&"GBP");
 B5*GOOGLEFINANCE("CURRENCY:"&A5&"GBP");
 B6*GOOGLEFINANCE("CURRENCY:"&A6&"GBP");
 IF(A7="", 0, B7*GOOGLEFINANCE("CURRENCY:"&A7&"GBP"))})

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124