Dear Community,
I had some progress on my calculations and would like to export my findings to an Excel Sheet, preferably with column headers. The underlying formula is the following:
h[i_] := {i,
Extract[Extract[f[i], {1}], {1}],
Association[Extract[Extract[f[i], {1}], {2}]][[Key[w]]],
Association[Extract[Extract[f[i], {1}], {2}]][[Key[x]]],
Association[Extract[Extract[f[i], {1}], {2}]][[Key[y]]],
Association[Extract[Extract[f[i], {1}], {2}]][[Key[z]]]}
and returns results like this list:
{7500, 1.44263, 3622.8, 3877.2, Missing["KeyAbsent", Key[y]], 0.}
Unfortunately
Export["RequestedTable.xls", {"Header A","Header B","Header C","Header D","Header E","Header F"},
SetPrecision[Table[h[i], {i, 7300, 7700, 100}], 5]]
throws an error, saying the length 0 of Header A does not match length 6 of the following list entries (or something like that...).
(EDIT: Changing the command to
Export["RequestedTable.xls",
Extract[{{"Header A","Header B","Header C","Header D","Header E","Header F"},
SetPrecision[Table[h[i], {i, 7300, 7700, 100}], 5]}]]
eliminates the error message, but the whole formula exports into one cell. Within this formula the values do have a high precision, though. It seems like they get lost while being written into single cells in the Excel sheet...?)
Neglecting the headers and executing the command
Export["RequestedTable.xls",
SetPrecision[Table[h[i], {i, 7300, 7700, 100}], 5]]
the export succeeds, but only with whole numbers. The numbers can be small, though, which requires an output including decimals. But although I'm using SetPrecision, the resulting Excel table only includes whole numbers. This raises three questions:
- Is it possible to return 0 (zero) instead of Missing["KeyAbsent", Key[whatever]]?
- How can I include a header into the export?
- Most important: How can I increase the precision of the export?
Best regards, Peter