How To Transpose Cells In One Column Based On Unique Values In Another Column?

Опубликовано: 04 Апрель 2026
на канале: Excel World
3,037
16

How To Transpose Cells In One Column Based On Unique Values In Another Column?

Supposing, you have a range of data that contains two columns, now, you want to transpose cells in one column to horizontal rows based on unique values in another column to get the following result

=UNIQUE($A$2:$A$19)
=TRANSPOSE(FILTER($B$2:$B$19,$A$2:$A$19=D2))
Excel Functions

🛎️ Subscribe To My Channel and Get More Tricks and Tips.

http://shorturl.at/aozQT

#MsExcelWorld

The Beginner's Guide to Excel Functions

Excel Tips & Tricks! Excel Formula bar! #shorts
#exceltips #exceltutorial #exceltricks

How to transpose cells in one column based on unique values in another column?
Transpose 1 column based on distinct values
Step 1: Identify Unique Values in Column A

In an empty column, let's say Column C, use the following formula to extract unique values from Column A:

excel
Copy code
=UNIQUE(A:A)
Drag this formula down to get a list of unique values from Column A.

Step 2: Transpose Corresponding Values from Column B

In an empty area (e.g., starting in Column D), enter the following formula:

excel
Copy code
=TRANSPOSE(FILTER(B:B, A:A=C1))
Replace C1 with the first cell reference in the unique values list from Step 1.

Drag this formula across the row to cover the range where you want the transposed data.

This formula uses the FILTER function to extract values from Column B where the corresponding value in Column A matches the unique value in cell C1.

Step 3: Repeat for All Unique Values

Copy the formula in Step 2 and paste it for all unique values in Column C.

Adjust cell references accordingly. For example, if your unique values start from C2, use C2 in the formulas.

Drag the formulas down to fill the desired number of rows.

After these steps, you should have the transposed data for each unique value in Column A. The unique values are in one row, and their corresponding values from Column B are transposed into the adjacent rows.

Note: If you're using an older version of Excel that doesn't have the UNIQUE function, you may need to use other methods to extract unique values. You could consider using a helper column with formulas like COUNTIF and filtering duplicates or using a pivot table to get unique values.

Remember to adjust cell references based on the actual location of your data in your spreadsheet.

User
pls provide the keywords tags for the above solution
ChatGPT
Certainly! If you want to create tags or keywords for a tutorial or video based on the solution provided for transposing cells in one column based on unique values in another column in Excel, you can consider the following:

Excel Transpose Tutorial
Transpose Cells Based on Unique Values
Excel Unique Values and Transpose
Data Transformation in Excel
Excel Data Manipulation
Excel Formulas for Transposing DataStep 1: Identify Unique Values in Column A

In an empty column, let's say Column C, use the following formula to extract unique values from Column A:

excel
Copy code
=UNIQUE(A:A)
Drag this formula down to get a list of unique values from Column A.

Step 2: Transpose Corresponding Values from Column B

In an empty area (e.g., starting in Column D), enter the following formula:

Excel
Copy code
=TRANSPOSE(FILTER(B:B, A:A=C1))
Replace C1 with the first cell reference in the list of the unique values from Step 1.

Drag this formula across the row to cover the range where you want the transposed data.

This formula uses the FILTER function to extract values from Column B where the corresponding value in Column A matches the unique value in cell C1.

Step 3: Repeat for All Unique Values

Copy the formula in Step 2 and paste it for all unique values in Column C.

Adjust cell references accordingly. For example, if your unique values start from C2, use C2 in the formulas.

Drag the formulas down to fill the desired number of rows.

After these steps, you should have the transposed data for each unique value in Column A. The unique values are in one row, and their corresponding values from Column B are transposed into the adjacent rows.

Note: If you're using an older version of Excel that doesn't have the UNIQUE function, you may need to use other methods to extract unique values. You could consider using a helper column with formulas like COUNTIF and filtering duplicates or using a pivot table to get unique values.

Remember to adjust cell references based on the actual location of your data in your spreadsheet.

#transpose
#filterfunction
#uniquefunction
#excelwork
#exceltutorial
#exceltips
#exceltricks