Function Problems

Move Data to the Correct Excel Column Based on a Cell Value

Huma Ashraf ChHuma Ashraf Ch Dec 2, 2026 868 views

Question details

Place each row's value in the destination column that matches its item type.

Move Data to the Correct Excel Column Based on a Cell Value
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains item types and associated values that need to be distributed into separate columns.
Observed behavior
Each value appears under its matching item-type header, while unrelated destination cells appear blank.
Before you start

Identify the item-type and value columns, and create destination headers that match the item types exactly. The example below uses column A for types, column B for values, and row 1 for destination headers.

Solution 1Recommended

Use an IF Formula to Match Values to Column Headers

Use this formula when destination headers contain the item types and you want results to update automatically.

1
Add destination headers

In Excel, enter item types such as Tree and Flower in cells C1 and D1, matching the type names in column A.

2
Enter the formula

Select C2 and enter =IF($A2=C$1,$B2,""). Press Enter to display the value from B2 only if A2 matches the header in C1.

3
Fill across and down

Select C2 and drag its fill handle across the destination columns and down through the data rows. Each formula compares the row's type with its column header.

4
Check the results

Review the destination columns to confirm that each value appears under its matching header and that other cells appear blank.

Use an IF Formula to Match Values to Column Headers
The source data remains in place: The formulas display results without removing the original values. Cells that appear blank still contain formulas.
WPS Spreadsheet

Distribute Values by Item Type in WPS Spreadsheet

Use the same IF formula in WPS Spreadsheet to place values under matching headers and update the results when source data changes.

  1. 1. Open the worksheet: Open WPS Spreadsheet and choose Open to select your Excel workbook.
  2. 2. Set up the headers: With item types in column A and values in column B, enter matching item-type headers in C1, D1, and any additional destination columns.
  3. 3. Enter the IF formula: Select C2, type =IF($A2=C$1,$B2,""), and press Enter.
  4. 4. Fill the destination range: Drag the fill handle from C2 across the destination columns and down to the last data row.
Automatically match each value to its item-type columnOpen and edit Microsoft Excel XLSX and XLS filesFill formulas across columns and down rowsUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

What if my type and value are in different columns?

Change $A2 and $B2 in the formula to your type and value columns. Keep the dollar sign before each column letter so those references stay fixed when you fill across.

Why is a value missing from its destination column?

Check that the item type in column A matches the destination header and that the value cell in column B is not empty. Extra spaces in a type or header can prevent a match.

Does the formula remove the original value?

No. The IF formula displays the value in the matching destination cell, but the original remains in the source column.

How can I keep the results without formulas?

Select and copy the destination range, then use Paste Special and choose Values. The pasted results will no longer update when the source data changes.