Sort value on non-contiguous rows in increasing/Decreasing order

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
My input range is A5:A21 which generates numerical values EXCEPT 0 or “” (null). ALSO they are non-contiguous rows.
Output range is C5:C21
IF A4=1, the values of C5:C21 should be in INCREASING order
IF A4=2, the values of C5:C21 should be in DECREASING order

How to achieve this?
Thanks in advance.
Book2.xlsx
ABCDE
4112
542000320042700
6421004200042600
7422004210042500
8
9423004220042500
10424004230042400
11
12425004240042300
13426004250042200
14
15427004250042100
16
17
1832004260042000
19
20
2142500427003200
Pr
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Amazing..liked the concept of helper column. Your formula works well shift-del, thanks for it
Please tell me In I5, why 16 is being used or rather how did you arrived at the figure of 16?
 
Upvote 0
See this explanation.
Mappe6
LMNOPQR
5functionfunction numbersorting orderyour numberyour sorting ordercommon minuendhow to get the function number from your number
6LARGE14descending2descending1614
7SMALL15ascending1ascending1615
Tabelle1
Cell Formulas
RangeFormula
Q6:Q7Q6=M6+O6
R6:R7R6=Q6-O6
 
Upvote 0
See this explanation.
Mappe6
LMNOPQR
5functionfunction numbersorting orderyour numberyour sorting ordercommon minuendhow to get the function number from your number
6LARGE14descending2descending1614
7SMALL15ascending1ascending1615
Tabelle1
Cell Formulas
RangeFormula
Q6:Q7Q6=M6+O6
R6:R7R6=Q6-O6
Thanks shift-del. Many thanks for all your efforts
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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