Ascendind/descending order

ANWAR ALAM

New Member
Joined
Mar 26, 2021
Messages
18
Office Version
  1. 2010
Platform
  1. Windows
Hi all! i write any number(say 69138) in cell A1. I want to display this number in both ascending order (13689) and descending order (98631) in cells B1 and C1, respectively. (1) Which formulas i should write in cells B1 and C1. (2) If i add a command button on the worksheet, then what will be the VBA CODE, behind this button for this same purpose. i shall be really grateful, if anybody can kindly help me. Thanks in anticipation and best regards!!!!!!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Welcome to the Forum!

ABC
1691381368998631
Sheet3
Cell Formulas
RangeFormula
B1B1=SUM(LARGE(0+MID(A1,N,1),N)*10^(N-1))
C1C1=SUM(SMALL(0+MID(A1,N,1),N)*10^(N-1))

where N: =ROW(INDIRECT("1:"&LEN(!$A1)))

I think you'll need to array-enter these formula, or use SUMPRODUCT rather than SUM for a non-array-entered formula
 
Upvote 0

Forum statistics

Threads
1,215,692
Messages
6,126,227
Members
449,303
Latest member
grantrob

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