{"id":13551084,"url":"https://github.com/dfinke/ImportExcel","last_synced_at":"2025-04-03T01:31:23.022Z","repository":{"id":29464783,"uuid":"33001311","full_name":"dfinke/ImportExcel","owner":"dfinke","description":"PowerShell module to import/export Excel spreadsheets, without Excel","archived":false,"fork":false,"pushed_at":"2024-10-21T23:44:41.000Z","size":77511,"stargazers_count":2553,"open_issues_count":84,"forks_count":410,"subscribers_count":131,"default_branch":"master","last_synced_at":"2025-03-27T00:06:30.987Z","etag":null,"topics":["excel","powershell"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/ImportExcel/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfinke.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-27T18:01:13.000Z","updated_at":"2025-03-26T00:22:22.000Z","dependencies_parsed_at":"2024-04-12T23:45:39.853Z","dependency_job_id":"d6fe2b19-4fe6-4144-b417-5a540a866578","html_url":"https://github.com/dfinke/ImportExcel","commit_stats":{"total_commits":1388,"total_committers":65,"mean_commits":"21.353846153846153","dds":"0.39841498559077815","last_synced_commit":"fa907da4a459d9da2d080d60f563333828313ef4"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinke%2FImportExcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinke%2FImportExcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinke%2FImportExcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinke%2FImportExcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfinke","download_url":"https://codeload.github.com/dfinke/ImportExcel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246916753,"owners_count":20854514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","powershell"],"created_at":"2024-08-01T12:01:42.092Z","updated_at":"2025-04-03T01:31:22.964Z","avatar_url":"https://github.com/dfinke.png","language":"PowerShell","funding_links":["https://www.paypal.com/paypalme/DougCharlesFinke"],"categories":["PowerShell","Data"],"sub_categories":[],"readme":"# PowerShell and Excel \n\n![](images/logoWithInstall.png)\n\n\u003cbr/\u003e\n\nHas the ImportExcel module helped you?\n- Made you look good to the boss?\n- Saved you time?\n- Made you more productive?\n\nConsider donating. Thank you!\n\u003cbr\u003e\n\u003cbr\u003e\n\u003ca href=\"https://www.paypal.com/paypalme/DougCharlesFinke\"\u003e\u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-green.svg\" alt=\"Donate\" height=\"28\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n![](https://media.giphy.com/media/hpXxJ78YtpT0s/giphy.gif)\n\u003cbr\u003e\n\u003cbr\u003e\n\n[![Follow on Twitter](https://img.shields.io/twitter/follow/dfinke.svg?style=social\u0026label=Follow%20%40dfinke)](https://twitter.com/dfinke)\n[![Subscribe on YouTube](https://img.shields.io/youtube/channel/subscribers/UCP47ZkO5EDkoI2sr-3P4ShQ\n)](https://youtube.com/@dougfinke/)\n\u003cbr/\u003e\n\u003cbr/\u003e\n[![](https://img.shields.io/powershellgallery/v/ImportExcel.svg)](https://www.powershellgallery.com/packages/ImportExcel)\n[![](https://img.shields.io/powershellgallery/dt/ImportExcel.svg)](https://www.powershellgallery.com/packages/ImportExcel)\n\u003ca href=\"https://www.paypal.com/paypalme/DougCharlesFinke\"\u003e\u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-green.svg\" alt=\"Donate\"\u003e\u003c/a\u003e\n\n# Overview\n\nAutomate Excel with PowerShell without having Excel installed. Works on Windows, Linux and Mac. Creating Tables, Pivot Tables, Charts and much more just got a lot easier.\n\n## Examples ✨\nCheck out the [more than 100 examples](Examples/) on ways to create amazing reports as well as make you more productive with PowerShell and Excel.\n\n# Basic Usage\n## Installation\n\n```powershell\nInstall-Module -Name ImportExcel\n```\n\n## Create a spreadsheet\nHere is a quick example that will create spreadsheet file from CSV data. Works with JSON, Databases, and more.\n\n```powershell\n$data = ConvertFrom-Csv @\"\nRegion,State,Units,Price\nWest,Texas,927,923.71\nNorth,Tennessee,466,770.67\nEast,Florida,520,458.68\nEast,Maine,828,661.24\nWest,Virginia,465,053.58\nNorth,Missouri,436,235.67\nSouth,Kansas,214,992.47\nNorth,North Dakota,789,640.72\nSouth,Delaware,712,508.55\n\"@\n\n$data | Export-Excel .\\salesData.xlsx\n```\n\n![](images/salesdata.png)\n\n## Read a spreadsheet\n\nQuickly read a spreadsheet document into a PowerShell array.\n\n```powershell\n$data = Import-Excel .\\salesData.xlsx\n\n$data\n```\n\n```powershell\nRegion State        Units Price\n------ -----        ----- -----\nWest   Texas        927   923.71\nNorth  Tennessee    466   770.67\nEast   Florida      520   458.68\nEast   Maine        828   661.24\nWest   Virginia     465   053.58\nNorth  Missouri     436   235.67\nSouth  Kansas       214   992.47\nNorth  North Dakota 789   640.72\nSouth  Delaware     712   508.55\n```\n\n## Add a chart to spreadsheet\n\nChart generation is as easy as 123. Building charts based on data in your worksheet doesn't get any easier.\n\nPlus, it is automated and repeatable.\n\n```powershell\n$data = ConvertFrom-Csv @\"\nRegion,State,Units,Price\nWest,Texas,927,923.71\nNorth,Tennessee,466,770.67\nEast,Florida,520,458.68\nEast,Maine,828,661.24\nWest,Virginia,465,053.58\nNorth,Missouri,436,235.67\nSouth,Kansas,214,992.47\nNorth,North Dakota,789,640.72\nSouth,Delaware,712,508.55\n\"@\n\n$chart = New-ExcelChartDefinition -XRange State -YRange Units -Title \"Units by State\" -NoLegend\n\n$data | Export-Excel .\\salesData.xlsx -AutoNameRange -ExcelChartDefinition $chart -Show\n```\n\n![](images/SalesDataChart.png)\n\n## Add a pivot table to spreadsheet\n\nCategorize, sort, filter, and summarize any amount data with pivot tables. Then add charts.\n\n```powershell\n$data = ConvertFrom-Csv @\"\nRegion,State,Units,Price\nWest,Texas,927,923.71\nNorth,Tennessee,466,770.67\nEast,Florida,520,458.68\nEast,Maine,828,661.24\nWest,Virginia,465,053.58\nNorth,Missouri,436,235.67\nSouth,Kansas,214,992.47\nNorth,North Dakota,789,640.72\nSouth,Delaware,712,508.55\n\"@\n\n$data | Export-Excel .\\salesData.xlsx -AutoNameRange -Show -PivotRows Region -PivotData @{'Units'='sum'} -PivotChartType PieExploded3D\n```\n\n![](images/SalesDataChartPivotTable.png)\n\n# Convert Excel data to other formats\n\n## Create a separate CSV file for each Excel sheet\n\nDo you have an Excel file with multiple sheets and you need to convert each sheet to CSV file?\n\n### Problem Solved\n\nThe [yearlyRetailSales.xlsx](Examples/Import-Excel) has 12 sheets of retail data for the year.\n\nThis single line of PowerShell converts any number of sheets in an Excel workbook to separate CSV files.\n\n```powershell\n(Import-Excel .\\yearlyRetailSales.xlsx *).GetEnumerator() |\nForEach-Object { $_.Value | Export-Csv ($_.key + '.csv') }\n```\n\n# Additional Resources\n\n## Videos\n\n- [Export-Excel Hello World](https://youtu.be/fvKKdIzJCws?list=PL5uoqS92stXioZw-u-ze_NtvSo0k0K0kq)\n- [Make Excel Data Pop](https://youtu.be/gQaYI5hxqM4?list=PL5uoqS92stXioZw-u-ze_NtvSo0k0K0kq)\n- [Slice And Dice Data](https://youtu.be/kzllxvqr3TY?list=PL5uoqS92stXioZw-u-ze_NtvSo0k0K0kq)\n- [Lightning talk - PowerShell Excel Module](https://youtu.be/znVu2q11Rp4?list=PL5uoqS92stXioZw-u-ze_NtvSo0k0K0kq)\n\n## More Videos\n\n- [Look smarter: deliver your work in Excel](https://youtu.be/tu8Mfkwi8zI) - James O'Neill [@jamesoneill](https://twitter.com/jamesoneill)\n- [Module Monday: ImportExcel](https://youtu.be/rBA_IeTmCb8?t=5) - Adam Driscoll [@adamdriscoll](https://twitter.com/adamdriscoll)\n- [Tutorials Excel Module Part 1](https://youtu.be/2cwBuYbZ3To)\n- [Tutorials Excel Module Part 2](https://youtu.be/8ojg-qjOnVI)\n- [Tutorials Excel Module Part 3](https://youtu.be/3IgASPD0UrQ)\n- [PowerShell Excel - Invoke-ExcelQuery](https://youtu.be/_7xuhsZm0Ao)\n- [Powershell Excel - Data Validation](https://youtu.be/NGhahuY8j1M)\n- [Creating Dashboards xPlatform](https://youtu.be/qMWkZt6ikgM)\n\n## Articles\n\n|Title|Author|Twitter|\n|------|------|------|\n|[More tricks with PowerShell and Excel](https://jamesone111.wordpress.com/2018/05/31/more-tricks-with-powershell-and-excel/)|James O'Neill|[@jamesoneill](https://twitter.com/jamesoneill)|\n|[Using the Import-Excel module: Part 1 Importing](https://jamesone111.wordpress.com/2017/12/05/using-the-import-excel-part-1-importing/)|James O'Neill|[@jamesoneill](https://twitter.com/jamesoneill)|\n|[Using the Import Excel module part 2: putting data into .XLSx files](https://jamesone111.wordpress.com/2017/12/11/using-the-import-excel-module-part-2-putting-data-into-xlsx-files/)|James O'Neill|[@jamesoneill](https://twitter.com/jamesoneill)|\n|[Using the import Excel Module: Part 3, Pivots and charts, data and calculations](https://jamesone111.wordpress.com/2017/12/12/using-the-import-excel-module-part-3-pivots-and-charts-data-and-calculations/)|James O'Neill|[@jamesoneill](https://twitter.com/jamesoneill)|\n|[Export AdventureWorksDW2017 to Excel for a Power BI Demo with Export-Excel](https://sqlvariant.com/2019/03/export-adventureworksdw2017-to-excel-for-a-powerbi-demo-with-export-excel-in-powershell/)|Aaron Nelson|[@sqlvariant](https://twitter.com/sqlvariant)\n|[Creating beautiful Powershell Reports in Excel](https://dfinke.github.io/powershell/2019/07/31/Creating-beautiful-Powershell-Reports-in-Excel.html)|Doug Finke|[@dfinke](https://twitter.com/dfinke)\n|[PowerShell Excel and Conditional Formatting](https://dfinke.github.io/powershell/2020/05/02/PowerShell-Excel-and-Conditional-Formatting.html)|Doug Finke|[@dfinke](https://twitter.com/dfinke)\n|[Learn to Automate Excel like a Pro with PowerShell](https://dfinke.github.io/powershell/2019/08/29/Learn-to-Automate-Excel-like-a-Pro-with-PowerShell.html)|Doug Finke|[@dfinke](https://twitter.com/dfinke)\n\n## Contributing\nContributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.\n\nOriginal [README.md](./README.original.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinke%2FImportExcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfinke%2FImportExcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinke%2FImportExcel/lists"}