Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Export Data from Mathematica to Excel
Replies: 8   Last Post: Oct 20, 2012 1:56 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Murray Eisenberg

Posts: 2,105
Registered: 12/6/04
Re: Export Data from Mathematica to Excel
Posted: Oct 20, 2012 3:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Oct 19, 2012, at 2:43 AM, minscheung@googlemail.com wrote:

> ...What about exporting financial data to excel?
>
> say
>
> MS=DateListPlot[FinancialData["MS", "Jan. 1, 2007]]
>
> I get this plot of Morgan Stanley daily price over the last 5 years.
>
> But exporting it using the following fails:
>
>
> Export["mfile_ms.xls", MS]
>
> it returns
>
> Failed
>
> Export::fmterr : Invalid XLS format.



First, you have a syntax in the FinancialData expression: there's a missing close-quotes. Fix that.

Next, do you want to export the data itself, or just the plot you created? If the former, then:

data = FinancialData["MS", "Jan. 1, 2007"]
Export["data.xls", data]

If the latter, then use the "Images" option:

MS=DateListPlot[FinancialData["MS", "Jan. 1, 2007"]]
Export["images.xls", {}, "Images" -> MS]

Instead of the second argument {}, you could include data. In any case, the exported graphic will be in a second sheet of the Excel spreadsheet. That second argument, for reasons I don't understand, seems to be necessary.
---
Murray Eisenberg
murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2838 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305









Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.