[{"data":1,"prerenderedAt":309},["ShallowReactive",2],{"topic:formula-equivalents":3},[4,14,19,25,30,35,40,45,51,57,62,67,72,77,83,88,93,99,104,109,114,119,125,130,136,141,146,151,156,161,167,172,177,182,187,192,197,202,207,212,217,222,227,232,237,242,247,252,257,262,267,272,277,283,288,293,299,304],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fextract-numbers-and-codes-from-text-with-pandas","Extract Numbers and Codes from Text with pandas","Pull order numbers, SKUs, quantities and amounts out of free-text cells like \"Re: PO-10442, 3 x SKU AB-1200 @ $12.50\". Use str.extract with named groups for one match per cell, extractall for many, fullmatch to validate codes, and a report of the rows where nothing matched.","how-to",[10,11,12],"data-cleaning","pandas","formula-equivalents",null,{"path":15,"title":16,"description":17,"type":8,"topics":18,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fsplit-full-names-into-first-and-last-names-with-pandas","Split Full Names into First and Last Names with pandas","A single \"Name\" column holds \"Ada Lovelace\", \"Lovelace, Ada\", \"Dr. Grace Hopper\", \"Ludwig van Beethoven\" and \"Smith Jr., John\". Split it into first and last names with rules for commas, titles, suffixes and surname particles, keep the original, and flag the names no rule should guess about.",[10,11,12],{"path":20,"title":21,"description":22,"type":8,"topics":23,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbin-values-into-ranges-with-pandas-cut","Bin Values into Ranges Like Excel FREQUENCY with pd.cut","Group order values, ages or delivery times into bands such as \"0-10\", \"10-50\" and \"over 100\". Use pd.cut with explicit edges and labels, decide which side of each band is closed, stop values outside the edges from silently becoming NaN, match Excel's FREQUENCY counts exactly, and use qcut for equal-sized groups.",[24,12,11],"pivots-and-summaries",{"path":26,"title":27,"description":28,"type":8,"topics":29,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcalculate-percent-of-total-per-group-in-pandas","Calculate Percent of Total per Group in pandas","Show each product's share of its region's sales, each region's share of the company, and a crosstab where every row adds to 100%. Use groupby transform for shares within groups, crosstab normalize for tables, keep rows with missing groups, and round shares so they still add up to exactly 100%.",[24,11,12],{"path":31,"title":32,"description":33,"type":8,"topics":34,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcount-distinct-values-per-group-in-pandas","Count Distinct Values per Group in pandas","Count unique customers per region, distinct products per order or active users per month — the \"Distinct Count\" that Excel pivot tables only offer through the Data Model. Use nunique, decide how blanks, case and spacing count, get several distinct counts at once, and avoid adding distinct counts across groups.",[24,12,11],{"path":36,"title":37,"description":38,"type":8,"topics":39,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fget-the-top-n-rows-per-group-in-pandas","Get the Top N Rows per Group in pandas","List the three best-selling products in each region, the largest invoice per customer, or the top five reps per quarter. Use sort_values with groupby().head(), decide what happens to ties with rank, rank aggregated totals rather than raw rows, and fold everything else into an \"Other\" line.",[24,11,12],{"path":41,"title":42,"description":43,"type":8,"topics":44,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fnumber-rows-within-each-group-in-pandas","Number Rows Within Each Group in pandas","Add a running number that restarts for every customer, region or order — the pandas equivalent of Excel's COUNTIF($A$2:A2,A2) and SQL's ROW_NUMBER() OVER (PARTITION BY ...): cumcount in a chosen order, ranks that handle ties, numbering consecutive runs, numbering the groups themselves, and writing the result to Excel.",[24,12],{"path":46,"title":47,"description":48,"type":49,"topics":50,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas","Excel Formula Equivalents in pandas","Translate SUMIF, COUNTIF, VLOOKUP, INDEX MATCH, nested IFs and text functions into pandas — with the mask-select-aggregate pattern behind all of them.","guide",[12,11],{"path":52,"title":53,"description":54,"type":8,"topics":55,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fapproximate-match-vlookup-in-pandas","Approximate-Match VLOOKUP for Tiered Rates in pandas","Look up commission rates, discount bands or tax brackets the way VLOOKUP(value, table, 2, TRUE) does — the largest threshold not above the value. Use merge_asof, searchsorted or pd.cut, handle values below the first tier, keep the tier table sorted, use different tiers per region, and calculate progressive (marginal) amounts correctly.",[12,56,11],"joins-and-lookups",{"path":58,"title":59,"description":60,"type":8,"topics":61,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Faverageifs-maxifs-minifs-in-pandas","AVERAGEIFS, MAXIFS and MINIFS Equivalents in pandas","Translate Excel's AVERAGEIFS, MAXIFS and MINIFS to pandas — boolean masks for one-off results, groupby for tables, transform for per-row columns — and reproduce Excel's handling of blanks, text, wildcards, date ranges and the empty case where MAXIFS returns 0.",[12,24,11],{"path":63,"title":64,"description":65,"type":8,"topics":66,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fchoose-switch-and-ifs-equivalents-in-pandas","CHOOSE, SWITCH and IFS Equivalents in pandas","Translate Excel's multi-way choice formulas into vectorised pandas: CHOOSE by position with a lookup list, SWITCH by value with Series.map and a default, IFS with ordered conditions using numpy.select, ranges with pandas.cut, what happens when nothing matches, and a check that each version gives the same answers as the spreadsheet formulas.",[12],{"path":68,"title":69,"description":70,"type":8,"topics":71,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fcorrel-and-linest-equivalents-in-python","CORREL and LINEST Equivalents in Python","Reproduce Excel's CORREL, PEARSON, RSQ and LINEST in pandas and NumPy: one correlation or a whole matrix, simple and multiple regression, the full five-row LINEST statistics block with standard errors, R², F and sums of squares, LINEST's reversed coefficient order, and a check against the spreadsheet's own result.",[12,11],{"path":73,"title":74,"description":75,"type":8,"topics":76,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fcountif-and-countifs-equivalent-in-pandas","COUNTIF and COUNTIFS Equivalent in pandas","Count matching rows by summing a boolean mask, count blanks and distinct values in one call, and replace a copied-down COUNTIF with groupby().transform('size').",[12,11],{"path":78,"title":79,"description":80,"type":8,"topics":81,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Feomonth-and-edate-equivalents-in-pandas","EOMONTH and EDATE Equivalents in pandas","Reproduce Excel's EDATE and EOMONTH in pandas for whole columns — month arithmetic that clamps 31 January to 28 February, month ends that do not depend on whether a date is already a month end, a different number of months per row, first-of-month dates and the time-of-day that Excel drops.",[12,82,11],"dates-and-times",{"path":84,"title":85,"description":86,"type":8,"topics":87,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fexact-and-case-sensitive-comparisons-in-pandas","EXACT and Case-Sensitive Comparisons in pandas","Excel compares text without regard to case — \"AB-100\"=\"ab-100\" is TRUE, and COUNTIF, MATCH, XLOOKUP and UNIQUE all ignore case — while pandas compares exactly. Reproduce both behaviours: EXACT as plain equality, Excel-style matching with casefold, COUNTIF with wildcards, first-match lookups and distinct counts, and see why a migrated report counts six products where the spreadsheet counted three.",[12,10],{"path":89,"title":90,"description":91,"type":8,"topics":92,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fexcel-if-formulas-as-pandas-conditional-columns","Excel IF Formulas as pandas Conditional Columns","IF becomes np.where and nested IFs become np.select, with pd.cut for numeric bands. Includes the IFERROR translation and why apply is the slow way to do it.",[12,11],{"path":94,"title":95,"description":96,"type":8,"topics":97,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fexcel-text-function-equivalent-in-pandas","Excel TEXT Function Equivalent in pandas","Turn numbers and dates into formatted text — \"1,234.50\", \"12.3%\", \"00042\", \"Mar 2026\", \"(1,234.50)\" — for labels, file names and email bodies, the way Excel's TEXT does. Map TEXT format codes to Python format specs and strftime, and fix the rounding difference that makes \"1,234.5\" come out as \"1,234\" instead of \"1,235\".",[12,98,11],"number-formats",{"path":100,"title":101,"description":102,"type":8,"topics":103,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fexcel-text-functions-left-right-mid-and-concat-in-pandas","Excel Text Functions LEFT, RIGHT, MID and CONCAT in pandas","Slicing replaces LEFT, RIGHT and MID; + and str.cat replace CONCATENATE and TEXTJOIN. Plus split, extract and the regex work that has no formula equivalent.",[12,11],{"path":105,"title":106,"description":107,"type":8,"topics":108,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Ffind-search-and-substitute-equivalents-in-pandas","FIND, SEARCH and SUBSTITUTE Equivalents in pandas","Translate Excel's FIND, SEARCH, SUBSTITUTE and REPLACE to pandas string methods: positions that start at 0 instead of 1, -1 instead of #VALUE!, case-insensitive search, Excel wildcards, replacing only the second occurrence, and the MID(FIND()) pattern for text between delimiters.",[12,10,11],{"path":110,"title":111,"description":112,"type":8,"topics":113,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fforecast-trend-and-slope-equivalents-in-python","FORECAST, TREND, SLOPE and RSQ Equivalents in Python","Reproduce Excel's linear trend functions — SLOPE, INTERCEPT, RSQ, CORREL, STEYX, TREND and FORECAST.LINEAR — with NumPy, matching the spreadsheet to many decimal places. Fit a trend per product, use dates as the x-axis, project the next periods, and know where a straight line stops being a forecast.",[12,24,11],{"path":115,"title":116,"description":117,"type":8,"topics":118,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Ffv-pv-rate-and-nper-equivalents-in-python","FV, PV, RATE and NPER Equivalents in Python","Reproduce Excel's time-value-of-money functions in Python: FV for a savings plan, PV for what a payment stream is worth, NPER for how long a loan takes, and RATE for the interest rate implied by a deal — with Excel's sign convention, the type argument for payments at the start of a period, zero-rate cases, vectorised versions for whole DataFrames, and a LibreOffice check that the numbers match.",[12],{"path":120,"title":121,"description":122,"type":8,"topics":123,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fgoal-seek-in-python-instead-of-excel","Goal Seek in Python Instead of Excel","Replace Excel's Goal Seek with scipy.optimize: find the price that hits a profit target, the interest rate behind a loan payment, a break-even value for every row of a DataFrame, and even goal-seek an Excel model itself by recalculating it in LibreOffice — with brackets, tolerances and failure checks.",[12,124],"excel-formulas",{"path":126,"title":127,"description":128,"type":8,"topics":129,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fgroupby-and-pivotby-function-equivalents-in-pandas","Excel GROUPBY and PIVOTBY Function Equivalents in pandas","Excel 365's GROUPBY and PIVOTBY functions summarise a table with one formula. Translate them to pandas: groupby with a grand total row, sorting by the value column, filtering rows before grouping, several aggregations at once, subtotals for two levels, pivot_table with row and column totals, and PERCENTOF shares — plus why a workbook that relies on them will not calculate outside Excel 365.",[12,24],{"path":131,"title":132,"description":133,"type":8,"topics":134,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fiferror-and-isna-equivalents-in-pandas","IFERROR, IFNA, ISNA and ISNUMBER Equivalents in pandas","In pandas, a division by zero is inf, a failed lookup is NaN and bad text fails to_numeric — there are no error cells to catch. Translate IFERROR, IFNA, ISNA, ISBLANK, ISNUMBER and ISTEXT into the pandas operations that match each case, and keep IFERROR's habit of hiding real problems out of your pipeline.",[12,135,11],"missing-data",{"path":137,"title":138,"description":139,"type":8,"topics":140,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Findex-match-equivalent-in-pandas","INDEX MATCH Equivalent in pandas","INDEX\u002FMATCH becomes map for one column and merge for several. Handle composite keys without a helper column, report unmatched keys, and use merge_asof for banded lookups.",[12,56,11],{"path":142,"title":143,"description":144,"type":8,"topics":145,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Findirect-and-offset-equivalents-in-pandas","INDIRECT and OFFSET Equivalents in pandas","Translate the jobs Excel workbooks do with INDIRECT and OFFSET into plain pandas: pick a sheet or column whose name is stored in a cell, sum a range that grows with the data, take the last N periods, look a fixed number of rows up or across, and build a summary across monthly sheets — with each formula checked against a spreadsheet's own result.",[12],{"path":147,"title":148,"description":149,"type":8,"topics":150,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fipmt-ppmt-effect-and-nominal-equivalents-in-python","IPMT, PPMT, EFFECT and NOMINAL Equivalents in Python","Split loan payments into interest and principal and convert between nominal and effective rates in Python, matching Excel: PMT, IPMT, PPMT and CUMIPMT\u002FCUMPRINC from first principles, Excel's sign convention, payments at the start or end of the period, EFFECT and NOMINAL for compounding frequencies, a vectorised schedule in pandas, and a check against the spreadsheet functions.",[12],{"path":152,"title":153,"description":154,"type":8,"topics":155,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fmatch-excel-rounding-in-pandas","Match Excel Rounding in pandas","pandas and Python round halves to the nearest even number, while Excel's ROUND rounds them away from zero — so 0.125 becomes 0.12 in pandas and 0.13 in Excel. Reproduce ROUND, ROUNDUP, ROUNDDOWN and MROUND exactly, and fix totals that differ by a penny.",[12,98,11],{"path":157,"title":158,"description":159,"type":8,"topics":160,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fmedian-mode-and-quartile-equivalents-in-pandas","MEDIAN, MODE and QUARTILE Equivalents in pandas","Match Excel's MEDIAN, MODE.SNGL, MODE.MULT, QUARTILE.INC, QUARTILE.EXC, PERCENTILE.INC and PERCENTILE.EXC in pandas: which quantile method equals which Excel function, why pandas' mode differs from MODE.SNGL when there is a tie, how Excel ignores text in ranges, per-group medians and quartiles, and a spreadsheet cross-check.",[12,11],{"path":162,"title":163,"description":164,"type":8,"topics":165,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fpmt-npv-and-irr-in-python","PMT, NPV, IRR and XIRR Excel Functions in Python","Reproduce Excel's financial functions in Python with numpy-financial: loan payments with PMT, FV, NPER and RATE, project values with NPV and IRR, and dated cash flows with XNPV and XIRR. Every result here matches the spreadsheet — including the NPV difference that catches almost everyone.",[12,11,166],"reliable-jobs",{"path":168,"title":169,"description":170,"type":8,"topics":171,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Frank-and-percentile-formulas-in-pandas","RANK and PERCENTILE Formulas in pandas","Match RANK.EQ with method='min' and ascending=False, rank within groups in one call, and replace LARGE, PERCENTILE and QUARTILE with nlargest, quantile and qcut.",[12,24,11],{"path":173,"title":174,"description":175,"type":8,"topics":176,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fregexextract-regextest-and-regexreplace-equivalents-in-pandas","REGEXTEST, REGEXEXTRACT and REGEXREPLACE Equivalents in pandas","Excel's new regular-expression functions map neatly onto pandas' string methods: REGEXTEST to str.contains, REGEXEXTRACT's three return modes to str.extract, str.findall and capture groups, and REGEXREPLACE to str.replace — with the differences that bite: $1 versus \\1 in replacements, the case-sensitivity argument, replacing only the nth match, #N\u002FA versus NaN, and patterns that behave differently in Python.",[12,10],{"path":178,"title":179,"description":180,"type":8,"topics":181,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Freplace-excel-solver-with-python","Replace Excel Solver with Python","Move Solver models out of a dialog box and into a script: read the decision data from a workbook, solve linear programmes with scipy.optimize.linprog, whole-number problems with milp, report which constraints bind and what an extra unit of each resource is worth, and write the plan back to Excel.",[12,11],{"path":183,"title":184,"description":185,"type":8,"topics":186,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fround-roundup-mround-and-ceiling-equivalents-in-python","ROUND, ROUNDUP, MROUND and CEILING Equivalents in Python","Reproduce Excel's rounding functions exactly in Python and pandas: why round(2.5) gives 2 and pandas rounds halves to even while Excel's ROUND rounds them away from zero, how floating point turns 2.675 into 2.67, and correct equivalents for ROUND, ROUNDUP, ROUNDDOWN, MROUND, CEILING and FLOOR — including negative digits and negative numbers — checked against a recalculated workbook.",[12,11],{"path":188,"title":189,"description":190,"type":8,"topics":191,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Frunning-totals-and-year-over-year-growth-in-pandas","Running Totals and Year-Over-Year Growth in pandas","cumsum for running totals, shift and pct_change for period comparisons, rolling for moving averages — and why a year-over-year join beats shift when months go missing.",[12,24,11],{"path":193,"title":194,"description":195,"type":8,"topics":196,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fscan-reduce-and-map-equivalents-in-pandas","SCAN, REDUCE, MAP and BYROW Equivalents in pandas","Excel's LAMBDA helper functions — SCAN for running results, REDUCE for a single accumulated value, MAP for element-by-element calculations, BYROW and BYCOL for per-row and per-column results — translated to pandas and the Python standard library: when a vectorised cumsum, cumprod or clip does the job, when only an itertools.accumulate loop reproduces SCAN (a balance that cannot go below zero), and how to keep the logic testable.",[12,11],{"path":198,"title":199,"description":200,"type":8,"topics":201,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsequence-and-randarray-equivalents-in-python","SEQUENCE and RANDARRAY Equivalents in Python","Generate the number grids, date series, random numbers and shuffled lists that Excel's SEQUENCE, RANDARRAY, RANDBETWEEN and SORTBY formulas produce, with NumPy and pandas: row-major sequences with start and step, monthly and business-day date series, seeded random arrays that are reproducible unlike Excel's, random samples without repeats, and writing the results to a sheet as values.",[12],{"path":203,"title":204,"description":205,"type":8,"topics":206,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsln-db-and-ddb-depreciation-functions-in-python","SLN, DB and DDB Depreciation Functions in Python","Reproduce Excel's depreciation functions exactly in Python: SLN straight line, SYD sum-of-years digits, DB fixed-declining balance with its three-decimal rate and partial first year, DDB double-declining balance that never switches to straight line, and VDB with its switch — each implemented, laid out as a schedule with pandas, and checked period by period against the spreadsheet functions.",[12],{"path":208,"title":209,"description":210,"type":8,"topics":211,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fstdev-and-var-equivalents-in-pandas","STDEV.S, STDEV.P, VAR.S and VAR.P in pandas and NumPy","pandas .std() and NumPy std() give different answers for the same numbers — one matches Excel's STDEV.S, the other STDEV.P. Match each Excel function exactly with ddof, choose between sample and population deliberately, handle single-value groups, and compute per-group spread, coefficients of variation and z-scores.",[12,24,11],{"path":213,"title":214,"description":215,"type":8,"topics":216,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsubtotal-and-aggregate-equivalents-in-pandas","SUBTOTAL and AGGREGATE Equivalents in pandas","Reproduce Excel's SUBTOTAL and AGGREGATE in pandas: totals that skip the subtotal rows already in a sheet, the 1–11 versus 101–111 function numbers that include or ignore hidden rows, and AGGREGATE's option to ignore error values — reading which rows are subtotals and which are hidden with openpyxl, and checking every result against LibreOffice.",[12,24],{"path":218,"title":219,"description":220,"type":8,"topics":221,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsumif-and-sumifs-equivalent-in-pandas","SUMIF and SUMIFS Equivalent in pandas","Translate conditional totals into pandas: boolean masks, several conditions joined with &, wildcards as string methods, and transform for a SUMIF copied down a column.",[12,11],{"path":223,"title":224,"description":225,"type":8,"topics":226,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsumproduct-and-weighted-average-in-pandas","SUMPRODUCT and Weighted Averages in pandas","Translate Excel's SUMPRODUCT to pandas — total value from quantity times price, conditional sums with boolean arrays, and weighted averages such as average price weighted by units. Covers weighted averages per group, missing weights, and why the plain mean of averages gives the wrong answer.",[12,24,11],{"path":228,"title":229,"description":230,"type":8,"topics":231,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Ftextbefore-textafter-and-textsplit-equivalents-in-pandas","TEXTBEFORE, TEXTAFTER and TEXTSPLIT Equivalents in pandas","Reproduce Excel's TEXTBEFORE, TEXTAFTER and TEXTSPLIT in pandas: text before or after the first, nth or last delimiter, case-insensitive matching, the crucial difference when the delimiter is missing (Excel returns #N\u002FA, str.partition returns the whole text), splitting into columns and into rows, and a check of every case against the spreadsheet functions.",[12],{"path":233,"title":234,"description":235,"type":8,"topics":236,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Ftextjoin-equivalent-in-pandas","TEXTJOIN Equivalent in pandas (Join Values per Group)","Combine many rows into one cell — every product a customer bought, \"North, South, East\" — the way Excel's TEXTJOIN does. Join per group with groupby and str.join, skip blanks like ignore_empty, convert numbers, de-duplicate and sort within each group, respect Excel's cell length limit, and split the result back into rows.",[12,24,11],{"path":238,"title":239,"description":240,"type":8,"topics":241,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Funique-sort-and-filter-equivalents-in-pandas","UNIQUE, SORT and FILTER Equivalents in pandas","Reproduce Excel's dynamic array functions in pandas: UNIQUE with drop_duplicates, \"values that appear exactly once\", SORT and SORTBY with sort_values, FILTER with boolean masks and an if_empty fallback, and the chained SORT(UNIQUE(FILTER())) pattern — plus the case-sensitive sort that puts \"Banana\" before \"apple\".",[12,11,10],{"path":243,"title":244,"description":245,"type":8,"topics":246,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fvstack-hstack-take-and-choosecols-equivalents-in-pandas","VSTACK, HSTACK, TAKE and CHOOSECOLS Equivalents in pandas","Translate Excel's array-shaping functions — VSTACK, HSTACK, TAKE, DROP, CHOOSECOLS, CHOOSEROWS, TOCOL and WRAPROWS — into pandas and NumPy, including the one difference that changes results: Excel stacks by position, pandas by column name and index. Each mapping is checked against the spreadsheet's own result.",[12,11],{"path":248,"title":249,"description":250,"type":8,"topics":251,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fxirr-and-xnpv-equivalents-in-python","XIRR and XNPV Equivalents in Python","Reproduce Excel's XNPV and XIRR for cash flows on irregular dates: the 365-day formula behind XNPV, a root-finder for XIRR that matches Excel to the last digit, why NPV and IRR give a different (wrong) answer for uneven dates, XIRR per investment with groupby, cases with no or several solutions, and a LibreOffice cross-check.",[12],{"path":253,"title":254,"description":255,"type":8,"topics":256,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fxlookup-equivalent-in-pandas","XLOOKUP Equivalent in pandas","Reproduce every XLOOKUP argument in pandas — exact lookups with a default for missing keys, Excel's case-insensitive matching, first or last match, next smaller or next larger item, wildcards, and returning several columns at once — with a reusable xlookup function.",[12,56,11],{"path":258,"title":259,"description":260,"type":8,"topics":261,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fxlookup-with-multiple-criteria-in-pandas","XLOOKUP with Multiple Criteria in pandas","Reproduce Excel lookups that match on two or more columns — XLOOKUP(1, (A=x)*(B=y), C) and its concatenated-key cousins — in pandas: an exact match on several keys with merge, a not-found default, guarding against duplicate keys, tiered \"next smaller\" matches by quantity with merge_asof, last-match lookups, and a check against the same XLOOKUP formulas recalculated in a workbook.",[12,56],{"path":263,"title":264,"description":265,"type":8,"topics":266,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fyearfrac-and-days360-equivalents-in-python","YEARFRAC and DAYS360 Equivalents in Python","Reproduce Excel's YEARFRAC with all five day-count bases and DAYS360 with the US and European methods in Python: 30\u002F360 rules for month ends and February, actual\u002F360, actual\u002F365, actual\u002Factual with its leap-year logic, a vectorised version for interest accrual tables in pandas, and a check against spreadsheet results for the awkward dates.",[12,82],{"path":268,"title":269,"description":270,"type":8,"topics":271,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Fvlookup-equivalent-in-pandas-for-excel-files","The VLOOKUP Equivalent in pandas for Excel Files","merge is the real answer, map is the fast one: translating a VLOOKUP into pandas, keeping the unmatched rows visible, handling duplicate lookup keys, and the approximate-match case VLOOKUP's fourth argument hides.",[12,56,11],{"path":273,"title":274,"description":275,"type":8,"topics":276,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fcalculate-age-and-tenure-from-dates-with-pandas","Calculate Age and Tenure from Dates with pandas (DATEDIF Equivalent)","Compute completed years, months and days between two dates for a whole column — ages from birth dates, tenure from hire dates, contract length — matching Excel's DATEDIF. Covers why days divided by 365.25 is wrong on birthdays, 29 February, an as-of date, fractional years and tenure bands.",[82,12,11],{"path":278,"title":279,"description":280,"type":8,"topics":281,"kind":13},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-fixed-asset-depreciation-schedule","Build a Fixed Asset Depreciation Schedule with Python","Turn a fixed asset register into a monthly depreciation schedule: straight-line and double-declining balance with the switch to straight line, a start-of-depreciation convention, disposals part way through the year, net book values, a cost and depreciation roll-forward by category, and a check against Excel's SLN and VDB functions.",[282,12],"report-layouts",{"path":284,"title":285,"description":286,"type":8,"topics":287,"kind":13},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-lease-liability-schedule","Build a Lease Liability Schedule","Calculate a lease liability and right-of-use asset the way IFRS 16 does, with pandas: discount the payments at the incremental borrowing rate, unwind interest month by month with payments in advance, depreciate the asset straight line, split the liability into current and non-current portions, produce the month's journals and a maturity analysis, and check the opening liability against Excel's PV function.",[282,12],{"path":289,"title":290,"description":291,"type":8,"topics":292,"kind":13},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-loan-amortization-schedule-in-excel","Build a Loan Amortization Schedule in Excel with Python","Generate a month-by-month repayment schedule: the payment from the annuity formula, interest and principal split per period, cent rounding and a final payment that clears the balance exactly, overpayments that shorten the term, totals and payoff date, and a workbook with live PMT formulas checked against the Python result.",[282,12],{"path":294,"title":295,"description":296,"type":8,"topics":297,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-python-in-excel\u002Frun-a-regression-with-python-in-excel","Run a Regression with Python in Excel","Fit a multiple linear regression in a =PY cell with statsmodels: read a table with xl(), fit with a formula, return a tidy coefficient table to the grid, predict with intervals, check the residuals with a chart, and confirm the numbers against LINEST.",[298,12],"python-in-excel",{"path":300,"title":301,"description":302,"type":8,"topics":303,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-excel-formulas-in-python\u002Frun-what-if-scenarios-on-an-excel-model-with-python","Run What-If Scenarios on an Excel Model with Python","Keep the Excel model as the single source of truth and let Python drive it: define scenarios as input values, write one copy of the model per scenario with openpyxl, recalculate them all in one headless LibreOffice call, read the outputs back, build a sensitivity table and write a scenario comparison workbook.",[124,12],{"path":305,"title":306,"description":307,"type":8,"topics":308,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-excel-formulas-in-python\u002Fturn-an-excel-model-into-a-python-function","Turn an Excel Model into a Python Function","Keep a profit model in Excel where finance owns it, and call it from Python like a function: compile the workbook's formulas with the formulas library into a callable that takes the input cells and returns the output cells, check its answers against LibreOffice, run two thousand Monte Carlo scenarios in a few seconds, and catch functions the library cannot evaluate before trusting the results.",[124,12],1790972052271]