1

In google sheets the following formula works fine

=GOOGLEFINANCE("Currency:" & H6 & I6) * G6

If I try to use it within a IF-statement it gives a parsing error.

=IF(H6! = "USD", GOOGLEFINANCE("Currency:" & H6 & I6) * G6, "fail")

Must be a syntax error, but I can't wrap my head around it. What am I doing wrong?

kishkin
  • 5,152
  • 1
  • 26
  • 40
bsparks
  • 61
  • 2

1 Answers1

1

You used wrong operator. There is no != like in Python. Use <> instead:

=IF(H6 <> "USD", GOOGLEFINANCE("Currency:" & H6 & I6) * G6, "fail")

Or just = if you meant equality check:

=IF(H6 = "USD", GOOGLEFINANCE("Currency:" & H6 & I6) * G6, "fail")

enter image description here

kishkin
  • 5,152
  • 1
  • 26
  • 40