This is Top N inside each group
It does not rank Tokyo and Osaka together and then keep three rows total. It keeps up to N rows from Tokyo, up to N from Osaka, and so on. The output contains the original rows, not a summarized ranking table.
Free web tool
Extract the top N rows by a numeric value within each CSV group.
Need the top 3 products in each store or the top 5 scores in each team? This ranks rows inside each group, rather than taking one global Top N.
It does not rank Tokyo and Osaka together and then keep three rows total. It keeps up to N rows from Tokyo, up to N from Osaka, and so on. The output contains the original rows, not a summarized ranking table.
With values 0, -1, -2, the top two are 0 and -1. Blank and non-numeric values are excluded from ranking, but zero is not treated as “missing.”
Tokyo and tokyo are different groups, and so are A and A . The tool does not trim or normalize group labels. Clean the group column first if those variants should be combined.
If you request Top 5 but a group has only three valid numeric rows, that group returns three. Blanks and text in the value column can also reduce the number of ranked rows.
If the result has fewer rows than roughly groups × N, it may simply be a small group—or it may point to missing/non-numeric scores. The output count is a quick reason to inspect the source values instead of assuming every group had enough rankable data.