How to find the top seller in each region in Excel
Formula (Excel and Google Sheets)
=XLOOKUP(1,($B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2)),$A$2:$A$10)Find each region's highest sales with MAXIFS and look up the rep with that region and amount: =XLOOKUP(1,($B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2)),$A$2:$A$10).
- Result on the example
- one result per row in
F2, filled down toF5 - Works in
- Excel 2021, 2024 and Microsoft 365
- Google Sheets
- Same formula
See it work
The formula is already in F2, filled down to F5. Change any input and the result updates, or edit the formula to experiment.
How it works
MAXIFS($C$2:$C$10,$B$2:$B$10,E2) is the best sales figure in the region: $57,300 for East. XLOOKUP then finds the row where the region is East and the sales equal that figure, and returns the rep. Checking the region as well matters, because the same figure could appear in another region.
=XLOOKUP(1,($B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2)),$A$2:$A$10)Result"Cara"
$B$2:$B$109 rows × 1 col: "East", "West", "East", "North", …A range: 9 cells in one column.
E2"East"The value in E2.
$B$2:$B$10=E2{9 rows × 1 col} TRUE, FALSE, TRUE, FALSE, …The = operator tests whether the two sides are equal.
$C$2:$C$109 rows × 1 col: $48,200, $61,750, $57,300, $39,800, …A range: 9 cells in one column.
MAXIFS($C$2:$C$10,$B$2:$B$10,E2)57300MAXIFS: Largest value that meets every condition.- max_range
$C$2:$C$109 rows × 1 col: $48,200, $61,750, $57,300, $39,800, … - criteria_range1
$B$2:$B$109 rows × 1 col: "East", "West", "East", "North", … - criteria1
E2"East"
- max_range
$C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2){9 rows × 1 col} FALSE, FALSE, TRUE, FALSE, …The = operator tests whether the two sides are equal.
$B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2){9 rows × 1 col} 0, 0, 1, 0, …The * operator multiplies.
$A$2:$A$109 rows × 1 col: "Ana", "Ben", "Cara", "Dev", …A range: 9 cells in one column.
XLOOKUP(1,($B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2)),$A$2:$A$10)"Cara"XLOOKUP: Searches one range and returns the matching item from another.- lookup_value
1 - lookup_array
$B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2){9 rows × 1 col} 0, 0, 1, 0, … - return_array
$A$2:$A$109 rows × 1 col: "Ana", "Ben", "Cara", "Dev", …
- lookup_value
In Google Sheets
The same formula works in Google Sheets: =XLOOKUP(1,($B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2)),$A$2:$A$10). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =INDEX($A$2:$A$10,MATCH(1,($B$2:$B$10=E2)*($C$2:$C$10=MAXIFS($C$2:$C$10,$B$2:$B$10,E2)),0)) | Cara, Ben, Gus… | For Excel 2019 (Ctrl+Shift+Enter). MAXIFS needs Excel 2019 or later. |
Common mistakes
- Looking up only the amount,
XLOOKUP(MAXIFS(…),$C$2:$C$10,$A$2:$A$10), can return a rep from another region who sold the same amount. - If two reps in a region tie, the one higher in the list is returned.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Find the top seller in each region
F2, return the rep with the highest sales in the region in E2, then fill down to F5.Questions
How do I return the top sales figure too?
Next to it, use =MAXIFS($C$2:$C$10,$B$2:$B$10,E2).
How do I find the lowest seller in each region?
Swap MAXIFS for MINIFS.
How do I build the region list automatically?
Use =UNIQUE(B2:B10) in E2 and point the formula at E2#.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.