Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Currency Conversion in Numbers

I'm pretty new to numbers, so forgive me if this is a dumb question.


I'm trying to convert a dollar amount in one cell to another currency in another cell. Preferrably with live exchange rates. Is there a way to do this?

MacBook Pro, OS X Mavericks (10.9.3)

Posted on Jun 11, 2014 5:26 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 11, 2014 6:58 PM

Add a column for CHF, and in the Header Paste the conversion figure. Let's say your Euros are in Column D; then your CHF calculation, assuming they will be in Column E, would be:


=E$1*D


or


=E$1/D


depending on which way you get the conversion from the website.


In a Footer row, write:


=SUM(D)


in Column D and Copy/Paste to the Footer cell of Column E.


Jerry

11 replies
Question marked as Top-ranking reply

Jun 11, 2014 6:58 PM in response to MichaelJarjour

Add a column for CHF, and in the Header Paste the conversion figure. Let's say your Euros are in Column D; then your CHF calculation, assuming they will be in Column E, would be:


=E$1*D


or


=E$1/D


depending on which way you get the conversion from the website.


In a Footer row, write:


=SUM(D)


in Column D and Copy/Paste to the Footer cell of Column E.


Jerry

Jun 11, 2014 7:28 PM in response to Jerrold Green1

Here's a way to automate this a little (one click updates the rate):


User uploaded file



The script below will place the Yahoo! Finance rate in the target cell here C1.


Copy into AppleScript Editor, click somewhere in table, click green triangle "Run" button.


SG



--click anywhere in table, run; places exchange rate in target cell

property targetCell : "C1"

property symbol : "eurchf=x" --> Swiss Francs per Euro

set sourceText to do shell script "curl -s http://finance.yahoo.com/q?s=" & symbol

set extractedText to extractBetween(sourceText, "yfs_a00_" & symbol & "\">", "</span>")

return placeValueInCell(extractedText, targetCell)


--handlers:

to placeValueInCell(theValue, targetCell)

try

tell application "Numbers" to tell front document to tell active sheet to tell ¬

(first table whose class of selection range is range) to set ¬

value of celltargetCell to theValue

on error

display dialog "Did you select a table?" buttons "Cancel" default button "Cancel"

end try

end placeValueInCell


to extractBetween(sourceText, startText, endText)

set {oTID, AppleScript'stext item delimiters} to {AppleScript'stext item delimiters, startText}

set endItems to text of text item -1 of sourceText-- everything after startText

set AppleScript'stext item delimiters to endText-- get ready to split endText

set textInBetween to text of text item 1 of endItems-- take everything before endText

set AppleScript'stext item delimiters to oTID-- restore original values

return textInBetween

end extractBetween

--end of script

Jun 11, 2014 5:53 PM in response to MichaelJarjour

Michael,


The conversion is easily done in Numbers, but the "Live" part would require some scripting; Automator and Applescript. I don't want to discourage you, but I'll just say that if it was me, I'd Copy and Paste from a Desktop Widget. If you have your heart set on this concept, there are examples in the history of these discussions and there are current helpers that will assist you with the scripting.


Jerry

Jun 11, 2014 6:11 PM in response to MichaelJarjour

Give us an example of the conversion you want to do and how you want it to appear in the document.


Jerry


Edit: While I am at it, I'll give you theKB instructions for creating a Web Clipping in Dashboard.


To make this work, Create the Web Clip Widget for the currency rate website you prefer. With your Numbers document open, switch to the Dashboard, Select and Copy the rate, switch back to Numbers and Paste the rate into your document.


J.

Currency Conversion in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.