Combine and Sort Results from Multiple Arrays in Excel
Question details
Combine matching results from multiple worksheets or arrays, calculate a total for each name, and sort the totals in descending order.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Names and their numeric results are stored in multiple worksheets or arrays and need to be consolidated into a ranked list.
- Observed behavior
- The desired output is one row per name with its combined total, ordered from highest to lowest.
Create a list of unique, nonblank names and identify the name and numeric result columns on each source worksheet. The examples use names in A3:A22 on the summary sheet and source data in columns A and B on Sheet1 and Sheet2; adjust the ranges to fit your workbook.
Use SUMIF and a Dynamic Array to Rank Combined Results
Use this approach in Microsoft 365 to produce a ranked list that updates when source values change.
SUMIF adds all matching records for each name, including duplicates within a source sheet. The formula assumes Sheet1 and Sheet2 contain names in A3:A100 and numeric results in B3:B100.
On the summary sheet, enter each name once in A3:A22. Adjust the formula's names range if your list is shorter or longer.
Select E3 and enter =LET(names,A3:A22,totals,SUMIF(Sheet1!$A$3:$A$100,names,Sheet1!$B$3:$B$100)+SUMIF(Sheet2!$A$3:$A$100,names,Sheet2!$B$3:$B$100),SORT(HSTACK(names,totals),2,-1)).
Press Enter and check the spilled list in columns E and F. Leave the output area empty so Excel can display all names and totals.

Use SUMIF and a Manual Sort in Older Excel Versions
Use this method when dynamic array functions such as HSTACK are unavailable.
Calculate and Rank Combined Totals in WPS Spreadsheet
Use SUMIF in WPS Spreadsheet to add matching results from multiple sheets, then sort the summary by total.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to load your workbook. Check that Sheet1 and Sheet2 contain names in column A and results in column B.
- 2. Create a summary: On a summary sheet, enter Name in A2 and Total in B2. List each unique name in A3:A22.
- 3. Add matching results: In B3, enter =SUMIF(Sheet1!$A$3:$A$100,A3,Sheet1!$B$3:$B$100)+SUMIF(Sheet2!$A$3:$A$100,A3,Sheet2!$B$3:$B$100), then drag the fill handle down through B22.
- 4. Sort the totals: Select A2:B22, choose Data > Sort, and sort by Total from largest to smallest. Reapply the sort when changed totals need a new ranking.

Frequently Asked Questions
How do I total multiple rows with the same name?
Use SUMIF with the name column as the criteria range and the result column as the sum range. It adds all matching rows, unlike XLOOKUP, which normally returns one match.
How can I include a third worksheet in the total?
Add another term such as +SUMIF(Sheet3!$A$3:$A$100,A3,Sheet3!$B$3:$B$100) to the manual formula. Adjust the sheet name and ranges to match your data.
Why does the dynamic array formula show a spill error?
Check the cells below and to the right of the formula for existing content, and clear the intended output area. Excel needs an empty range to display the full list.
Will the sorted list update when source values change?
The SORT formula recalculates and reorders the spilled results as values change. With the manual Data > Sort method, reapply the sort to refresh the ranking.




