logo
search
Data Import & Export

How to Transpose Excel Data Horizontally and Remove Duplicates

Olivia MillerOlivia Miller Sep 28, 2026 871 views

Question details

The user needs to convert vertically structured data into horizontal columns while filtering out repeated lot numbers, and requires alternative methods for older software versions.

How to Transpose Excel Data Horizontally and Remove Duplicate Lot Numbers
Product
Excel
Device & OS
not provided
Scenario
Reorganizing vertical data layouts into a horizontal format and filtering out duplicate lot number entries for cleaner reporting.
Observed behavior
Attempting to use modern dynamic array formulas like TOROW and FILTER returns a 'That function is not valid' error in older spreadsheet versions.
Before you start

Verify your current software version by navigating to File > Account, as the most efficient formula methods require Microsoft 365 or Excel Online.

Solution 1Recommended

Use Dynamic Array Formulas (TOROW and FILTER)

The most efficient method for Microsoft 365 and Excel Online users to instantly filter and transpose data with a single formula.

Dynamic array formulas automatically spill the results into adjacent empty cells, making data reorganization seamless. This method is highly recommended if you are using a modern version of the software.

1
Select the destination cell

Click on the empty cell where you want the transposed horizontal data to begin.

2
Enter the formula

Type the formula =TOROW(FILTER($B$2:$E$9,$A$2:$A$9=G2),,0) into the formula bar, adjusting the cell references to match your actual data ranges.

3
Apply the formula

Press Enter to execute the formula. The data will automatically filter out the specified lot numbers and spill horizontally across the columns.

Use Dynamic Array Formulas (TOROW and FILTER)
Version Compatibility: If this formula returns a '#NAME?' or 'function is not valid' error, your version does not support dynamic arrays. Proceed to the alternative methods below.
Efficient Data Management

Use WPS Spreadsheet to Transpose Data and Filter Duplicates

WPS Office offers a feature-rich Spreadsheet application that provides advanced data tools, comprehensive formula support, and seamless format conversions—completely free of charge. You can easily clean up duplicate entries and transpose your layouts without compatibility headaches.

  1. 1. Open your data file: Launch WPS Spreadsheet and open the document containing your vertical data and lot numbers.
  2. 2. Remove duplicates: Select your data range, navigate to the Data tab, and click the 'Remove Duplicates' icon to instantly clean the dataset.
  3. 3. Copy the data: Highlight the deduplicated vertical data and press Ctrl+C to copy it to your clipboard.
  4. 4. Transpose horizontally: Right-click the target cell, select 'Paste Special', check the 'Transpose' option, and click OK to convert the data horizontally.
Free to use with a lightweight and fast installation.Fully compatible with Microsoft Excel (.xlsx and .xls) file formats.Built-in robust Data tools like Remove Duplicates and Paste Special Transpose.Supports advanced functions and array processing for complex data tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get a 'function is not valid' error when using TOROW or FILTER?

This error occurs because older versions of Excel (such as Excel 2016 or 2019) do not support modern dynamic array functions. You need Microsoft 365 or Excel Online to use functions like TOROW, TOCOL, and FILTER.

How do I check which version of Excel I am currently using?

Open your spreadsheet application, click on the File tab in the top-left corner, and select Account (or Help in older versions). Your exact version and build details will be displayed under the Product Information section.

Can I transpose data using a PivotTable?

Yes, PivotTables are excellent for grouping and transposing data in older versions. Insert a PivotTable, drag your Lot Number field into the Rows area to automatically group duplicates, and place the data fields you want to transpose into the Columns or Values areas.