Function Problems

How to Move Duplicate Student Email Data into One Excel Row

Khadija KhanKhadija Khan Oct 12, 2026 870 views

Question details

The user needs to consolidate duplicate student records by merging a second email address into the primary student's row and deleting the remaining duplicate rows.

How to Move Duplicate Student Email Data into One Excel Row
Product
Excel
Device & OS
not provided
Scenario
Organizing a student contact list where some students have multiple rows for different email addresses, with the goal of combining them into a single row per student.
Observed behavior
Student records are split across multiple rows due to multiple email addresses, requiring a method to merge the data onto one row and remove the redundant records.
Before you start

Ensure your dataset is sorted by the student identifier (such as Student ID or Name) so that duplicate records appear in directly adjacent rows before applying any consolidation formulas.

Solution 1Recommended

Use the IF Function and Remove Duplicates Feature

This method works best when duplicate records are adjacent. It uses a simple IF formula to pull the second email into the first row, followed by cleaning up the duplicates.

1
Sort the data

Select your dataset and go to Data > Sort to organize records by the student identifier column (e.g., Column A) so duplicates are grouped together.

2
Enter the IF formula

In an empty column next to the primary email, enter =IF(A2=A3,C3,"") (assuming Column A is the ID and Column C is the email) and press Enter.

3
Apply to all rows

Click the bottom-right corner of the cell containing the formula and drag the fill handle down to apply it to the rest of the column.

4
Convert formula to values

Select the newly calculated column, copy it (Ctrl+C), right-click the same selection, and choose Paste Special > Values to lock the data.

5
Remove duplicate rows

Select your entire data range, go to the Data tab > Remove Duplicates, check the student identifier column only, and click OK to delete the redundant rows.

Use the IF Function and Remove Duplicates Feature
Data Consolidated: Your student records are now neatly organized with multiple emails shifted into a single row per student.
Efficient Data Management

Consolidate Duplicate Data Easily with WPS Spreadsheet

WPS Spreadsheet provides powerful data tools, including advanced formulas and a one-click 'Remove Duplicates' feature, to help you clean up and consolidate contact lists seamlessly.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your duplicated student records.
  2. 2. Sort and apply formula: Sort by the student ID. In a new column, use the =IF(A2=A3,C3,"") formula to shift the secondary email up.
  3. 3. Paste as values: Copy the new column, click the 'Paste' dropdown in the Home tab, and select 'Paste as Values'.
  4. 4. Remove duplicates: Navigate to the Data tab, click 'Remove Duplicates', select your identifier column, and apply.
Fully compatible with Microsoft Excel formulas and file formats (.xlsx)Intuitive interface for sorting, filtering, and data cleanupLightweight application that runs smoothly on any deviceBuilt-in essential data functions and array formulas for free
microsoft office alternative - wps office

Frequently Asked Questions

Why did my IF formula return an error or unexpected result?

This typically happens if the data is not sorted first. The formula =IF(A2=A3,C3,"") relies on duplicate records being exactly adjacent to each other. Ensure you sort your data by the student identifier before applying the formula.

How can I merge more than two email addresses per student?

If students have three or more emails, you can use a combination of the TEXTJOIN function and IF arrays (e.g., =TEXTJOIN(", ", TRUE, IF(A$2:A$10=A2, C$2:C$10, ""))). Alternatively, use the Power Query tool to group by student ID and combine the text.

Do I have to convert the formula to values before removing duplicates?

Yes. If you skip the Paste Special > Values step, removing duplicate rows will shift the cell references. This will cause the remaining formulas to calculate incorrectly or display a #REF! error.

Can I use the 'Consolidate' tool for text data like emails?

No, the built-in Data > Consolidate tool is designed primarily for summarizing numerical data (like calculating sums or averages) and cannot be used to concatenate text strings such as email addresses.