Auto Sort Excel 2016

Rubber Beaked Woodpecker

Board Regular
Joined
Aug 30, 2015
Messages
203
Office Version
  1. 2021
In A1:A10 I have the product types.
In B1:B10 I have the number of products sold.

These cells are auto populated using an array formula. However these cells can be out of order and I would like to have the highest number of sold products in A1:B1. I know I can use the sort function but is there a way to do this using a lookup table as I would rather not use the manual sort function. I use excel 2016.

Thank you
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
use Power Query, sort values descending, then load to the sheet
after update source table and refresh query table it will be sorted with your definition
 
Upvote 0
Upvote 0
before
sourceresult
ProductSoldProductSold
item013item0242
item0242item0642
item037item0522
item0418item0418
item0522item037
item0642item013
after update and refresh
sourceresult
ProductSoldProductSold
item013item09102
item0242item0882
item037item0762
item0418item0242
item0522item0642
item0642item0522
item0762item0418
item0882item037
item09102item013
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Sort = Table.Sort(Source,{{"Sold", Order.Descending}, {"Product", Order.Ascending}})
in
    Sort
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top