Tellsheet
HomeExcel Guides › Top N per Group

How to Get the Top N Rows per Group in Excel

The biggest sale per customer. The top three scores per team. It sounds simple, but MAXIFS gives you the number without the row, and top-3 means array formulas and rank helpers. Here's the one-click way that keeps the winning rows whole.

Last updated: August 2026

Orders (Customer · Amount)Top 1 per customer
A · 100, A · 300, A · 200A · 300
B · 50, B · 70B · 70
C · 90C · 90

Why MAXIFS isn't enough

=MAXIFS(Amount, Customer, "A") tells you the top value for customer A — but not which order it was, so you lose the date, product, and everything else on that row. Ask for the top 2 or 3 and it gets much worse: you're into LARGE with array entry, or a helper column that ranks rows within each group with a nested COUNTIFS, then a filter. A PivotTable's Top-N filter ranks a field, not whole source rows. It's a lot of scaffolding for a common question.

The 1-click way — Tellsheet's Top N per Group

Run Top N per Group. Pick the group column (customer, team, region), the value column to rank by, whether to keep the top or the bottom, and how many per group. It keeps the whole rows that win — every column intact — and writes them to a new sheet. Groups stay in first-seen order and ties keep their original order, so the result is stable. Pairs with Group & Summarize and Find Outliers.

Frequently asked questions

Do I get the whole row or just the value?

The whole row — every column of the winning records, not just the top number.

Can I get the bottom N instead?

Yes — switch Keep to Bottom for the smallest N per group.

How many can I keep per group?

Any number — top 1, top 3, top 10 — applied within each group.

How are ties handled?

Tied rows keep their original order, and groups appear in first-seen order, so it's predictable.

Related Excel guides

Get the top rows per group in one click

Top N per Group keeps the highest or lowest N whole rows within each group, ranked by a value column — on a new sheet.

Get Tellsheet free See pricing