# Excel
{id: excel}

## Spreadsheets
{id: spreadsheets}

* CSV files - use the standard csv library
* Microsoft Excel files (various versions and formats)
* Open Office / Libre Office Calc



## Python Excel
{id: python-excel}

* [Python Excel](http://www.python-excel.org/)
* [openpyxl](https://openpyxl.readthedocs.org/)
* [xlsxwriter](https://xlsxwriter.readthedocs.org/)
* [xlrd](http://xlrd.readthedocs.io/)
* [xlwt](http://xlrd.readthedocs.io/)
* [xlutils](http://xlutils.readthedocs.io/) using xlrd and xlwt. Mostly obsolete.



## Create an Excel file from scratch
{id: create-an-excel-file-from-scratch}
{i: Workbook}
{i: active}
{i: save}
{i: column_dimensions}

![](examples/excel/create_excel.py)


## Worksheets in Excel
{id: worksheets-to-excel}
{i: create_sheet}

![](examples/excel/create_worksheets.py)


## Add expressions to Excel
{id: add-expressions-to-excel}

Nothing special needed.

![](examples/excel/expression.py)


## Format field
{id: format-field}

![](examples/excel/format_field.py)


## Number series and chart
{id: number-series-and-chart}

![](examples/excel/create_chart.py)


## Read Excel file
{id: read-excel-file}

![](examples/excel/read_excel.py)


## Update Excel file
{id: update-excel-file}

![](examples/excel/update_excel.py)

## Barchart
{id: number-series-and-barchart}

![](examples/excel/bar_chart.py)



## Exercise: Excel
{id: exercise-excel}

* Create a series of 10 random numbers between 1 and 100 and save them in an Excel file in a column.
* Create a graph showing the values.
* Add a second series of 10 random numbers, add them to the Excel file as a second column next to the first one.
* Add a 3rd colum containing the average of the first two columns.
* Update the graph to include all 3 number serieses





