Formulas & Excel logic

Excel functions in pandas

SUMIF, COUNTIF, IF, INDEX MATCH, LEFT/MID and friends, translated function by function.

Excel functions paired with pandas equivalents: SUMIFS becomes a filtered sum or groupby, VLOOKUP becomes merge, and IF becomes numpy where.Excel functions paired with pandas equivalents: SUMIFS becomes a filtered sum or groupby, VLOOKUP becomes merge, and IF becomes numpy where.the Excel function and the pandas line that replaces itSUMIFSgroupby().sum()or a mask + sumVLOOKUPmerge(how="left")on the keyIFnp.where(cond,yes, no)COUNTIF(col == x).sum()value_counts()

Start with the full guides

The long-form treatment of excel functions in pandas, with the reasoning the shorter pages assume.

Step-by-step how-tos

One task each, with code you can copy, run and adapt.

Follow it through a track

Prefer an ordered route? These tracks cover excel functions in pandas along the way, in the order that builds on itself.

Related topics

Subjects that keep turning up on the same pages as this one, most overlap first.

Excel functions in pandas is part of Formulas & Excel logic.