Graphics, Figures & Tables ⇒ Import Excel tables
Import Excel tables
Hi guys,
Anyone can say me if there is any possibility to import tables from excel directly to LaTeX. If I do copy and paste I should to insert the & to do the columns. There is any option to do this automatically?
Thanks for your help,
Tiago
Anyone can say me if there is any possibility to import tables from excel directly to LaTeX. If I do copy and paste I should to insert the & to do the columns. There is any option to do this automatically?
Thanks for your help,
Tiago
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Import Excel tables
Hi there,
From what I know, there is no copy/paste from excel to LaTeX. Damn
, and sorry for the deception. But keep the smile
, there is a macro that you can get at http://cobweb.ecn.purdue.edu/~zhang97/xls2latex/ and use it directly.
Cheers
From what I know, there is no copy/paste from excel to LaTeX. Damn


Cheers
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Import Excel tables
Another possible solution could be to export the Excel table values as CSV and generate a proper LaTeX table with latable.
Best regards
Thorsten
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Import Excel tables
Thanks another for your help. Without you I don't know what I would to be 

Re: Import Excel tables
Hi another,
Thorsten,
I'm using Latable but I'm having problems. I save my file in CVS format and after I open the file with Latable but the columns remains in just one column. I don't Understand Why. I've experimented other possibilities to do the same but nothings worked.
I've tried also the sugestion of fatra2 but it doesn't work also. I have the office 2007 and I think his sugestion just works with office 2003.
Have you another sugestion to my problems?
Best regards,
Tiago
Thorsten,
I'm using Latable but I'm having problems. I save my file in CVS format and after I open the file with Latable but the columns remains in just one column. I don't Understand Why. I've experimented other possibilities to do the same but nothings worked.
I've tried also the sugestion of fatra2 but it doesn't work also. I have the office 2007 and I think his sugestion just works with office 2003.
Have you another sugestion to my problems?
Best regards,
Tiago
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Import Excel tables
Some bad news ahead.
- For a considerable time I seldom run Windows.
- I don't have any Excel version installed (but OpenOffice.org).
- I never used latable.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Import Excel tables
http://www.ctan.org/tex-archive/support/excel2latex/
is a macro to be installed in excel, then excel can export tabels to LaTeX format. Never tried it myself, but several students have used it.
is a macro to be installed in excel, then excel can export tabels to LaTeX format. Never tried it myself, but several students have used it.
Re: Import Excel tables
Hi there,
Excel2LaTeX is a cool macro. The difference to xls2latex is very simple.
excel2latex macro creates a file with the table into, which can be very useful if you intend to use the same table in multiple codes. xls2latex copies the table on the clipboard, allowing you to paste it into your LaTex code.
I tried both and depending on the situation, both work perfectly.
Cheers
Excel2LaTeX is a cool macro. The difference to xls2latex is very simple.
excel2latex macro creates a file with the table into, which can be very useful if you intend to use the same table in multiple codes. xls2latex copies the table on the clipboard, allowing you to paste it into your LaTex code.
I tried both and depending on the situation, both work perfectly.
Cheers
Re: Import Excel tables
Hi another,
I'm being mad with this. I've experimented the latex2Excel . And it doesn't works I don't know why. I open the Macro. It appears a new command "Convert Excel to Latex" but after, when i Pull it, appears an error message of Visual Basic. What fault I'm doing? Anyone can explain me?
Thanks a lot for your attention,
Tiago
I'm being mad with this. I've experimented the latex2Excel . And it doesn't works I don't know why. I open the Macro. It appears a new command "Convert Excel to Latex" but after, when i Pull it, appears an error message of Visual Basic. What fault I'm doing? Anyone can explain me?
Thanks a lot for your attention,
Tiago
Re: Import Excel tables
A couple other options to consider:
OpenOffice Calc will allow you to export your spreadsheet as an HTML document. You could then try an HTML2TeX converter. (There are a few out there.) I don't have experience with this personally.
Here's another "brute" method I have actually done, and it works, though it's a bit involved, and still leaves you to do a lot of work manually:
1. Open your spreadsheet in Calc. After the last column containing data, put \\ in the first row in the next column, then use Fill > Down to put the same in every row in that (new) last column.
2. Select the entire table and press Ctrl-C to copy.
3. Leave OpenOffice Calc open. Open OpenOffice Writer (its word-processor), which I assume you also have. Hit Ctrl-Shift-V to "Paste (Special)". Choose either to paste as HTML or RTF, not "calc8" or anything else. This will put the spreadsheet into a word-processor table.
[At this point you could save the file and try some kind of Word>LaTeX or RTF>LaTeX converter. Haven't tried those... but soldiering on...]
4. Under the "Table" menu, choose Convert > Table to Text. Under "Separate Text At:" under "Other" put in &. Click OK.
5. Step 4 won't give you the option of putting in spaces before or after &, which would be easier to read in LaTeX, so you might now want to do Find & Replace all "&"s with " & " (e.g., put a space on both sides). You might also want to find and replace "& \\" with "\\" to avoid an extra column in LaTeX.
You now have the "guts" of a LaTeX tabular environment you can cut and paste into your favorite LaTeX editor. You'll still need to add the \begin{tabular}{...} \end{tabular} lines, and anything you want like \hline and so on.
If you want all that taken care of for you, this probably isn't the best method, but I like to do all that stuff myself anyway to format it for my current document.
OpenOffice Calc will allow you to export your spreadsheet as an HTML document. You could then try an HTML2TeX converter. (There are a few out there.) I don't have experience with this personally.
Here's another "brute" method I have actually done, and it works, though it's a bit involved, and still leaves you to do a lot of work manually:
1. Open your spreadsheet in Calc. After the last column containing data, put \\ in the first row in the next column, then use Fill > Down to put the same in every row in that (new) last column.
2. Select the entire table and press Ctrl-C to copy.
3. Leave OpenOffice Calc open. Open OpenOffice Writer (its word-processor), which I assume you also have. Hit Ctrl-Shift-V to "Paste (Special)". Choose either to paste as HTML or RTF, not "calc8" or anything else. This will put the spreadsheet into a word-processor table.
[At this point you could save the file and try some kind of Word>LaTeX or RTF>LaTeX converter. Haven't tried those... but soldiering on...]
4. Under the "Table" menu, choose Convert > Table to Text. Under "Separate Text At:" under "Other" put in &. Click OK.
5. Step 4 won't give you the option of putting in spaces before or after &, which would be easier to read in LaTeX, so you might now want to do Find & Replace all "&"s with " & " (e.g., put a space on both sides). You might also want to find and replace "& \\" with "\\" to avoid an extra column in LaTeX.
You now have the "guts" of a LaTeX tabular environment you can cut and paste into your favorite LaTeX editor. You'll still need to add the \begin{tabular}{...} \end{tabular} lines, and anything you want like \hline and so on.
If you want all that taken care of for you, this probably isn't the best method, but I like to do all that stuff myself anyway to format it for my current document.