Writing to an Excel file layout is possible, but can be complicated and requires add-ons.
One way many write to Excel is to create csv files. For instance, if you create a file called output.csv:
output.csv
smith,200,10
barry,300,12
harry,12,2001
Excel would read this as a spreadsheet with three rows of data, each row with three columns. Would this accomplish what you want?