Function Problems

How to Use SUMIF in WPS Office Spreadsheets to Match Names That Begin with a First Name

Jason MillerJason Miller Nov 13, 2026 869 views

Question details

The user needs to calculate salary totals or averages for employees whose names begin with a specified first name, including records where initials or other characters follow the first name.

Use SUMIF in WPS Office Spreadsheets for Names That Begin with a First Name
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
A user has an employee salary table with names in one column and salaries in another, and wants to aggregate values by first name using a criterion cell.
Observed behavior
The desired result is for SUMIF or AVERAGEIF to match the leading first name and ignore the rest of the name, such as initials after the first name.
Before you start

Make sure the employee names and salary values are in adjacent columns, and place the first-name criterion in a separate cell such as A19. Confirm that the criterion cell contains only the first name with no leading or trailing spaces.

Solution 1Recommended

Use SUMIF with a Wildcard Criterion to Total Salaries by First Name

Use this method to sum salary amounts for all employees whose names start with the first name entered in a criterion cell.

The asterisk wildcard in SUMIF matches zero or more characters after the first name. This allows one formula to include names such as "Steve M.", "Steve P.", and other variations that begin with "Steve".

1
Select the result cell

Click the cell where you want the total salary to appear, for example C19.

2
Enter the SUMIF formula

Type =SUMIF($A$2:$A$16,A19&"*",$B$2:$B$16) and press Enter. Here $A$2:$A$16 contains employee names, A19 contains the first-name criterion, and $B$2:$B$16 contains salaries.

3
Check wildcard matching

Review the result to confirm that names followed by initials or extra characters are included in the total.

Use SUMIF with a Wildcard Criterion to Total Salaries by First Name
Expected result: The formula returns the total salary for every employee whose name begins with the first name in A19.
WPS Spreadsheets formula guide

Use Wildcard SUMIF and AVERAGEIF Formulas in WPS Office Spreadsheets

WPS Office Spreadsheets supports the same wildcard criteria as Excel, so you can total or average salary data by first name without changing your formulas.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office, click Open, and select the Excel workbook that contains the employee names and salary data.
  2. 2. Enter the SUMIF wildcard formula: Select the cell for the total and type =SUMIF($A$2:$A$16,A19&"*",$B$2:$B$16), adjusting the ranges to match your sheet.
  3. 3. Add an AVERAGEIF formula when needed: Select another cell and type =AVERAGEIF($A$2:$A$16,A23&"*",$B$2:$B$16), where A23 contains the first name.
  4. 4. Verify names and totals: Check the results against names such as Steve M. and Steve P. to confirm the wildcard includes all entries beginning with the first name.
Applies the SUMIF and AVERAGEIF wildcard method directly to employee name and salary tables.Maintains compatibility with Microsoft Excel .xlsx workbooks, so existing formulas continue to work.Offers a familiar spreadsheet interface with a lightweight and free WPS Office download.Supports common Excel functions, formatting, and workbook migration without rewriting formulas.
QA img-9

Frequently Asked Questions

Does WPS Spreadsheets support the SUMIF wildcard technique used in Excel?

Yes. WPS Spreadsheets supports SUMIF with wildcard criteria, so a formula like =SUMIF($A$2:$A$16,A19&"*",$B$2:$B$16) works the same way it does in Microsoft Excel.

How can SUMIF match names that start with a first name but have initials afterward?

Use the criterion cell followed by an asterisk wildcard, such as A19&"*". The asterisk matches any characters after the first name, including initials like Steve M. or Steve P.

Which ranges should be absolute in the SUMIF formula?

Use absolute references for the name range and salary range, such as $A$2:$A$16 and $B$2:$B$16. This lets you copy the formula without shifting the ranges.

How do I calculate an average salary for a first name instead of a total?

Use AVERAGEIF with the same wildcard technique, for example =AVERAGEIF($A$2:$A$16,A23&"*",$B$2:$B$16), where A23 contains the first name.

Will extra spaces before the first name break the SUMIF matching?

Yes. Leading or trailing spaces in the name cells or criterion cell can prevent a match, so clean the data or use TRIM to remove unwanted spaces before applying SUMIF.