Latex to Excel

Converting LaTeX tables to Excel is a pain; here are some steps I found useful for reformatting and removing persistent hidden whitespace characters:

  • remove the \\ symbols and import the latex text document in Excel with the ampersand symbol (&) set as a delimiter (simple and good idea from this blog post – thank you Ever Barbero!)
  • replacing intervening table code (e.g. \multicolumn{5}{c} ) and remaining curly brackets with nothing
  • and replacing sub-/super-script (eg. ^2) and other symbol codes (eg. \chi) with their equivalent unicode characters (e.g. χ²)
  • using the ‘TRIM(cell reference)’ formula in Excel to remove space characters except for single space between words/values…. However in itself I found this did not work satisfactorily.  Through trial and error I found that the embellishment of the TRIM() function as TRIM(CLEAN(cell reference)) removes hidden characters which trim alone may not. I had hidden spaces screwing up alignment of table items, and expanding this formula —actually, IF(ISBLANK(cell reference,””,TRIM(CLEAN(cell reference))) , so empty cells didnt’ return as errors — to reference the tables contents, and then pasted as values over the top solved this problem.

Whilst writing this post I found a StackOverflow post covering this and a few other tips which would have saved me some trial and error time if I found it sooner.