Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Export Data from Mathematica to Excel

2,483 views
Skip to first unread message

Tugrul Temel

unread,
Feb 27, 2008, 4:32:04 AM2/27/08
to
Hi,

I have a Mathematica matrix format by (5*2) below

Var1, 12
Var2, 3
Var3, 45
Var4, 78
Var5, 6

How can I export this matrix to an Excel file?

Thanks
Tugrul

Bill Rowe

unread,
Feb 28, 2008, 3:13:38 AM2/28/08
to
On 2/27/08 at 4:26 AM, tem...@xs4all.nl (Tugrul Temel) wrote:

>I have a Mathematica matrix format by (5*2) below

>How can I export this matrix to an Excel file?

Export["filename.xls", data, "XLS"]

where data is a variable containing the matrix you want to
export. This will export it to a native Excel file. An
alternative would be,

Export["filename.csv", data, "CVS"]

This will export the matrix to a comma separated file. While
this isn't a native Excel file, under Windows with the default
installation, double clicking it will cause Excel to open it and
load it automatically.
--
To reply via email subtract one hundred and four

minsc...@googlemail.com

unread,
Oct 19, 2012, 2:49:08 AM10/19/12
to
Hi, 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.


Anyone?

Joug Raw

unread,
Oct 20, 2012, 3:22:12 AM10/20/12
to

Not sure if you want the plot or the data. If you want the plot try to
export it with .gif .png .jpg and so on. If you want the data try to save
as .xlsx file.

JR

Murray Eisenberg

unread,
Oct 20, 2012, 3:23:25 AM10/20/12
to
On Oct 19, 2012, at 2:43 AM, minsc...@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
mur...@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






Benedetto Bongiorno

unread,
Oct 20, 2012, 1:55:12 PM10/20/12
to
Mathematica and Excel data interchange is and continues to be a hit and miss
issue.

I have reported it to Wolfram and "it is being worked on"

-----Original Message-----
From: minsc...@googlemail.com [mailto:minsc...@googlemail.com]
Sent: Friday, October 19, 2012 1:43 AM
Subject: Re: Export Data from Mathematica to Excel

Hi, 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.


Anyone?




Joug Raw

unread,
Oct 20, 2012, 1:56:01 PM10/20/12
to

Sorry, Export as .xlsx

On Fri, Oct 19, 2012 at 1:03 PM, Joug Raw <jou...@gmail.com> wrote:

> Not sure if you want the plot or the data. If you want the plot try to
> export it with .gif .png .jpg and so on. If you want the data try to save
> as .xlsx file.
>
> JR
>
>
> On Fri, Oct 19, 2012 at 8:43 AM, <minsc...@googlemail.com> wrote:
>

Peter Klamser

unread,
Oct 20, 2012, 1:56:11 PM10/20/12
to

Export["mfile_ms.xls", FinancialData["MS", "Jan. 1, 2007]]???

2012/10/19 <minsc...@googlemail.com>
0 new messages