1
votes

I am looking to order to the columns(B:I) in sheet 2 of an excel file based on the column order in sheet 1(A). Here is an example file

sheet1:

Item-ID
AS-469
BI-567
DI-328
ST-340
WI-989

sheet2:

Item-ID Item     Cost   Markup   pc1    oc2    ow3   er4    er5
ST-340  Stroller $145  30%       0.457  3.55    500 2.38    150
BI-567  Bib      $3.56  40%      0.525  3.25    400 2.17    100
DI-328  Diapers  $21.4 35%       0.606  2.93    300 1.95    50
WI-989  Wipes    $5.12  40%      0.675  2.75    250 1.71    0
AS-469  Aspira   $2.56  45%      0.746  2.57    200 2.55    2.54

Note: sort and order the column (A-Z or Z-A) is not an option as the original file is not sorted alphabetically.

Thank all m

1

1 Answers

0
votes

Use below formula :

=MATCH(A2,Sheet1!$A$2:$A$6,0)

Considering your sheet1 data is residing at A2:A6

In your sheet two use the above formula at next to the last non blank column, drag this formula, you will see bunch of numbers, these numbers are positions of Item-Id in your first sheet, Use sort method based on these numbers in second sheet to sort .

See the figure (second sheet), now you need to sort this based on Match form column.

enter image description here