Display "Sort by" Heading

dmmitchell

New Member
Joined
May 5, 2002
Messages
2
I have a sales report with headings such as: Customer Name, 2001 Sales, 2002 Sales, 2002 Plan, etc.

I want to automatically display the "sort by" heading on the worksheet, and whether it is increasing or decreasing.

For example: "Sorted by decreasing 2002 sales"

Thanks,
Dave
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
On 2002-05-06 07:11, dmmitchell wrote:
I have a sales report with headings such as: Customer Name, 2001 Sales, 2002 Sales, 2002 Plan, etc.

I want to automatically display the "sort by" heading on the worksheet, and whether it is increasing or decreasing.

For example: "Sorted by decreasing 2002 sales"

Thanks,
Dave

Assuming, say, your 2002 Sales start in C2, with the required heading in C1, this should get you started :

="Sorted by "&IF(C2=MIN(C2:C1000),"in",IF(C2=MAX(C2:C1000),"de","NEEDS SORTING"))&"creasing 2002 Sales"

it's not foolproof though, it just checks to see if the first value is min or max

adjust the ranges too so they don't look at any totals
 
Upvote 0
On 2002-05-06 08:05, Chris Davison wrote:
Assuming, say, your 2002 Sales start in C2, with the required heading in C1, this should get you started :

="Sorted by "&IF(C2=MIN(C2:C1000),"in",IF(C2=MAX(C2:C1000),"de","NEEDS SORTING"))&"creasing 2002 Sales"

it's not foolproof though, it just checks to see if the first value is min or max

adjust the ranges too so they don't look at any totals

Thanks Chris, but what I really want is a way to look at the settings selected when the data was last sorted. When you open the sort dialog box, it displays the settings from your last sort. (Heading or headings & ascending or descending) These settings must be stored by excel somewhere. I want to be able to print out their values.

I would accept a formula which analyzes the data table and figures out how it must have been sorted, but this sounds like a kludgy solution.

Thanks,
Dave
 
Upvote 0
kludgy's my middle name

:wink:

sounds like you're going to need one of our VBA coding experts to help you out with those internal sorting settings
 
Upvote 0

Forum statistics

Threads
1,214,533
Messages
6,120,076
Members
448,943
Latest member
sharmarick

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