[{"data":1,"prerenderedAt":193},["ShallowReactive",2],{"topic:sheets-and-files":3},[4,13,20,26,31,36,43,49,54,60,65,70,76,81,87,93,99,104,110,116,121,127,133,138,143,148,153,158,163,168,173,178,183,188],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fcombine-sheets-with-different-layouts-into-one-table","Combine Sheets with Different Layouts into One Table","Stack sheets that hold the same kind of data in different layouts — headers on different rows, columns in a different order and under different names, extra columns, total rows — into one clean table with pandas: find each sheet's header row, map column synonyms to standard names, drop totals and notes, record the source, and report columns that could not be mapped instead of losing them.","how-to",[10,11],"messy-sheets","sheets-and-files",null,{"path":14,"title":15,"description":16,"type":8,"topics":17,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Fappend-new-rows-to-a-master-excel-file-without-duplicates","Append New Rows to a Master Excel File Without Duplicates","Weekly extracts overlap — the same invoices appear in this week's file and last week's — and appending them blindly fills the master workbook with duplicates. Find genuinely new rows with a key-based anti-join, decide what to do with rows that changed, append with openpyxl so the master's formatting and table survive, keep reruns idempotent, and log every run.",[18,11,19],"joins-and-lookups","writing-excel",{"path":21,"title":22,"description":23,"type":8,"topics":24,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Fconcatenate-excel-sheets-with-different-columns","Concatenate Excel Sheets with Different Columns","Stack monthly exports whose columns drift — align headers, map renamed fields, keep a source column, and report what each file was missing before you combine them.",[18,11,25],"pandas",{"path":27,"title":28,"description":29,"type":8,"topics":30,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Fmerge-excel-files-with-different-column-names","Merge Excel Files with Different Column Names in pandas","Two systems export the same customers under different headers — \"Customer No\" and \"cust_id\", \"Email\" and \"email_address\" — with keys formatted differently. Map both files to one schema, normalise the keys, merge on several columns and combine the overlapping fields with a clear rule for which source wins.",[18,11,25],{"path":32,"title":33,"description":34,"type":8,"topics":35,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Fmerge-more-than-two-excel-files-on-a-key-column","Merge More Than Two Excel Files on a Key Column","Combine several workbooks that describe the same records — HR, payroll, IT and training exports keyed by employee ID — into one wide table: chain merges with functools.reduce, keep keys that appear in only some files, avoid _x\u002F_y column collisions, record which files each key came from, catch duplicate keys before they multiply rows, and write the result with a coverage summary.",[18,11],{"path":37,"title":38,"description":39,"type":8,"topics":40,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fread-multiple-excel-sheets-with-polars","Read Multiple Excel Sheets with Polars","Read the month sheets of a workbook into one Polars DataFrame — list sheet names without loading data, pick sheets by pattern, force consistent column types across sheets, stack them with the right concat mode, turn sheet names into dates and repeat across many workbooks.",[41,11,42],"polars","reading-excel",{"path":44,"title":45,"description":46,"type":8,"topics":47,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Fprocess-multiple-excel-files-in-parallel-with-python","Process Multiple Excel Files in Parallel with Python","Use every core on a folder of workbooks with ProcessPoolExecutor — why threads do not help, how to return small results, error isolation per file, and when parallelism makes things worse.",[48,11],"large-files",{"path":50,"title":51,"description":52,"type":8,"topics":53,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Fsplit-a-large-excel-file-into-files-of-n-rows","Split a Large Excel File into Files of N Rows","Break a big workbook into smaller ones for an upload limit, an import tool or an email attachment: the simple pandas version, a streaming version with openpyxl read-only and write-only modes that keeps memory flat, the header repeated in every part, dates kept as dates, numbered file names, and a check that no row was lost or duplicated.",[48,11],{"path":55,"title":56,"description":57,"type":8,"topics":58,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fconsolidate-employee-expense-claims-into-a-report","Consolidate Employee Expense Claims into a Report","Turn a folder of employee expense claim forms into one checked report with pandas and openpyxl: read header cells and the claim table from each form, convert foreign-currency lines, apply policy rules such as category limits, missing receipts and duplicate claims, summarise by employee and cost centre, and write a workbook with an exceptions sheet for the approver.",[59,11],"report-layouts",{"path":61,"title":62,"description":63,"type":8,"topics":64,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fconsolidate-timesheets-from-many-workbooks","Consolidate Timesheets from Many Workbooks with Python","Everyone fills in the same timesheet template and sends it back; you need hours by project and person for the week. Read the name and week from each file's header cells, unpivot the day grid into rows, spot who has not submitted, catch unknown project codes, impossible days and short weeks, and write one consolidated workbook.",[11,59,25],{"path":66,"title":67,"description":68,"type":8,"topics":69,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-multi-sheet-excel-dashboards\u002Fwrite-multiple-dataframes-to-one-excel-file","Write Multiple DataFrames to One Excel File","Write several pandas DataFrames into one .xlsx: separate sheets via one ExcelWriter, stacking on a single sheet with startrow, and appending with mode='a'.",[19,11,25],{"path":71,"title":72,"description":73,"type":8,"topics":74,"kind":12},"\u002Fautomating-reporting-workflows\u002Ferror-handling-and-logging-in-excel-automation\u002Fignore-excel-lock-files-when-processing-a-folder","Ignore Excel Lock Files When Processing a Folder","Stop a folder-processing job from crashing on the files Excel and LibreOffice leave next to open workbooks: recognise ~$ owner files, .~lock files and temporary save files, skip half-copied workbooks that are not yet valid zip files, notice when a workbook is open in someone's Excel, and report what was skipped and why.",[75,11],"reliable-jobs",{"path":77,"title":78,"description":79,"type":8,"topics":80,"kind":12},"\u002Fautomating-reporting-workflows\u002Fgenerating-excel-reports-from-templates\u002Fgenerate-one-excel-report-per-region-in-a-loop","Generate One Excel Report per Region in a Loop","Split one dataset into many workbooks safely: a filename that cannot collide or break a filesystem, one failure that does not stop the batch, atomic writes, an empty-group decision, and a manifest of what was produced.",[59,11],{"path":82,"title":83,"description":84,"type":8,"topics":85,"kind":12},"\u002Fautomating-reporting-workflows\u002Fscheduling-python-excel-scripts-with-cron\u002Fwatch-a-folder-and-process-new-excel-files","Watch a Folder and Process New Excel Files with Python","Process each workbook as soon as it lands in a drop folder. Watch the folder with watchdog, ignore Excel's lock and temporary files, wait until a file has finished copying, hand files to a single worker through a queue, move them to processed or failed folders, pick up anything that arrived while the watcher was down, and poll instead on network shares.",[86,11],"scheduling",{"path":88,"title":89,"description":90,"type":8,"topics":91,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fcreating-charts-in-excel-with-openpyxl\u002Fcreate-one-chart-per-group-with-openpyxl","Create One Chart per Group with openpyxl","Turn a long table — sales by region and month — into a grid of small charts, one per region, generated in a loop: write each group as its own block, build a chart that references only that block, lay the charts out in a grid with computed anchors, give every chart the same axis scale so they can be compared, or put each group on its own sheet with its chart.",[92,11],"charts-and-images",{"path":94,"title":95,"description":96,"type":8,"topics":97,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-excel-files-inside-a-zip-archive-with-python","Read Excel Files Inside a ZIP Archive with Python","Read workbooks straight out of a .zip without unpacking it: list the members, open one with zipfile and pass it to pd.read_excel, loop over every workbook while skipping __MACOSX and lock-file junk, read archives downloaded into memory, handle password-protected ZIPs, and understand the errors pandas gives when handed the archive itself.",[42,98,11],"file-formats",{"path":100,"title":101,"description":102,"type":8,"topics":103,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-excel-sheets-whose-names-change-with-pandas","Read Excel Sheets Whose Names Change with pandas","Find the right sheet when its name changes every month, differs in case or spacing, moves position or hides behind a hidden tab — by pattern, by date in the name, by visibility or by the columns it contains.",[42,11,25],{"path":105,"title":106,"description":107,"type":8,"topics":108,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-invalid-worksheet-name-errors","Fix Invalid Worksheet Name Errors When Writing Excel","Sheet names built from data — regions, customers, dates — break Excel's rules: 31 characters at most, none of [ ] : * ? \u002F \\, no leading or trailing apostrophe, unique regardless of case. See what openpyxl, xlsxwriter and pandas do with each rule and write one function that makes any name safe.",[109,11,19],"troubleshooting",{"path":111,"title":112,"description":113,"type":8,"topics":114,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-worksheet-does-not-exist-keyerror-in-openpyxl","Fix \"Worksheet Does Not Exist\" KeyError in openpyxl","Why openpyxl raises KeyError on a sheet you can see in Excel: hidden whitespace, case, renamed tabs and index confusion — plus a resilient sheet lookup helper.",[109,11,115],"openpyxl",{"path":117,"title":118,"description":119,"type":8,"topics":120,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fset-the-active-sheet-and-tab-colour-with-openpyxl","Set the Active Sheet, Selected Cell and Tab Colours with openpyxl","Decide what a reader sees when a generated workbook opens: which sheet is in front, which cell is selected, where the view is scrolled to, and which tabs are coloured. Includes the trap that leaves two sheets grouped after wb.active changes, and the xlsxwriter equivalents.",[59,115,11],{"path":122,"title":123,"description":124,"type":8,"topics":125,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-excel-formulas-in-python\u002Fwrite-formulas-that-reference-other-sheets-with-openpyxl","Write Formulas That Reference Other Sheets with openpyxl","Link a summary sheet to its data sheets with formulas like =SUM('Sales Data'!B2:B50). Learn the quoting rules for sheet names with spaces and apostrophes, build references with a helper instead of f-strings, and avoid the openpyxl trap where renaming a sheet silently breaks every formula that pointed at it.",[126,115,11],"excel-formulas",{"path":128,"title":129,"description":130,"type":131,"topics":132,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python","Working with Multiple Excel Sheets in Python","Read, transform, and write multi-sheet Excel workbooks with pandas and openpyxl — load all tabs into a dict, merge across sheets, and export to named sheets.","guide",[11,25,115],{"path":134,"title":135,"description":136,"type":8,"topics":137,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fapply-the-same-change-to-every-sheet-in-a-workbook","Apply the Same Change to Every Sheet in a Workbook","Make one change across every worksheet of a workbook — or of a folder of workbooks — with openpyxl: style the header row, freeze it, set number formats by column heading, add a footer and a print setup, while skipping chart sheets, hidden sheets and sheets that do not have the expected layout, logging what was changed on each sheet and making the run safe to repeat.",[11,115],{"path":139,"title":140,"description":141,"type":8,"topics":142,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fcombine-multiple-excel-files-into-one-python","Combine Multiple Excel Files into One in Python","Merge many .xlsx files into one workbook with pandas — glob the folder, concat with name-based column alignment, track the source file, and export the result.",[11],{"path":144,"title":145,"description":146,"type":8,"topics":147,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fcopy-a-sheet-between-excel-workbooks-with-python","Copy a Sheet Between Excel Workbooks with Python","openpyxl's copy_worksheet only works inside one workbook — here is what actually happens when you copy across files, how to carry values and styles over, and when to copy the file instead.",[11,115],{"path":149,"title":150,"description":151,"type":8,"topics":152,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fcreate-a-sheet-for-each-group-in-a-dataframe","Create a Sheet for Each Group in a DataFrame","Split one DataFrame into one worksheet per region, customer or month with groupby and ExcelWriter — with safe sheet names, a contents sheet, consistent formatting, and the silent overwrite trap when two groups map to the same name.",[11,19,25],{"path":154,"title":155,"description":156,"type":8,"topics":157,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Flist-every-sheet-with-its-size-and-visibility","List Every Sheet with Its Size and Visibility","Produce an inventory of a workbook, or a folder of workbooks, with one row per sheet: visible, hidden or very hidden, chart sheet or worksheet, the used range Excel reports against the range that actually holds data, counts of formulas, tables, charts, images, merged cells and validation rules, protection, and the space each sheet takes inside the file — written to an Excel report.",[11,115],{"path":159,"title":160,"description":161,"type":8,"topics":162,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fmerge-workbooks-into-one-file-with-a-sheet-per-source","Merge Workbooks into One File with a Sheet per Source","Collect a folder of workbooks into a single file where each source keeps its own tab: turn file names into valid, unique sheet names under the 31-character limit, copy values quickly with pandas or copy values, styles, widths and merged cells with openpyxl, handle source files with several sheets, and add an index sheet that links to every tab.",[11,115],{"path":164,"title":165,"description":166,"type":8,"topics":167,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fread-all-sheets-from-an-excel-file-into-dataframes","Read All Sheets from an Excel File into DataFrames","sheet_name=None returns a dictionary of every sheet — how to use it, why one ExcelFile beats repeated read_excel calls, how to filter and concatenate sheets, and what it costs on a large workbook.",[11,42,25],{"path":169,"title":170,"description":171,"type":8,"topics":172,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Frename-reorder-and-delete-excel-sheets-with-openpyxl","Rename, Reorder and Delete Excel Sheets with openpyxl","Sheet housekeeping that does not break the workbook: the 31-character title rules, move_sheet and the index list, safe deletion, hiding instead of removing, and which tab opens first.",[11,115],{"path":174,"title":175,"description":176,"type":8,"topics":177,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fsave-each-sheet-of-a-workbook-as-a-separate-file","Save Each Sheet of a Workbook as a Separate File","Split a workbook into one .xlsx file per sheet while keeping each sheet's formatting: remove the other sheets with openpyxl, freeze formulas that point at sheets that will no longer exist, drop defined names that would dangle, make hidden sheets visible, build safe file names, and know when a values-only split with pandas or a full-fidelity split through Excel is the better tool.",[11,115],{"path":179,"title":180,"description":181,"type":8,"topics":182,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fsearch-every-sheet-and-workbook-for-a-value","Search Every Sheet and Workbook in a Folder for a Value","Find which workbook, sheet and cell contain an invoice number, a customer name or a pattern across a whole folder of Excel files. Match exactly, by substring or by regular expression, treat 1042 and \"1042\" as the same, skip lock files and broken files, and search thousands of workbooks quickly in read-only mode.",[11,115,48],{"path":184,"title":185,"description":186,"type":8,"topics":187,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fsplit-one-excel-sheet-into-multiple-files-by-value","Split One Excel Sheet into Multiple Files by Column Value","Break a combined export into one workbook per region, customer or month — groupby, safe filenames, sheets vs files, and keeping formatting on every split output.",[11],{"path":189,"title":190,"description":191,"type":8,"topics":192,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fsum-the-same-cell-across-sheets-with-3d-references","Sum the Same Cell Across Many Sheets with 3D References from Python","Build a summary sheet that totals the same cell on every monthly or regional tab with Excel 3D references like =SUM(Jan:Dec!B2), written from Python with openpyxl — bookend sheets, quoting rules, inserting new tabs in the right place, and which functions support 3D ranges.",[11,126,115],1790972052270]