I take it you've got some values and you want to create a file that Excel can read. The easiest-to-create file format Excel understands probably is CSV, comma-separated values, i.e. a plain text file like this example (from Wikipedia):
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
1999,Chevy,"Venture ""Extended Edition, Very Large""","",5000.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",4799.00
Now, there are several ways to create CSV files. In very simple cases,
awk might do; however, there're many tools/libraries designed for this task, the answers here (SO) mention a few. (The CRUSH (Custom Reporting Utilities for SHell) tools mentioned there might be interesting for step 1., too.)