HWL
Active Member
- Joined
- Dec 1, 2009
- Messages
- 462
Okay, so I have a list of numbers generated by a formula that I want to sort in numberical order another column using an array formula.
THE PROBLEM, the piece of code I found that can do this breaks because it is counting the blank cells as not blank because they contain a formula.
I want to take my column of numbers in column B and then sort them numerically in column C.
The code I have so far which works only if the numbers in B are typed in, it breaks if there are blanks generated by a formula
:
=IF(ISERROR(INDEX($B$3:$B$100, MATCH(SMALL(IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), ROW(1:1)), IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), 0))),"",INDEX($B$3:$B$100, MATCH(SMALL(IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), ROW(1:1)), IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), 0))) USE CTRL+SHIFT+ENTER
Assistance on this is greatly appreciated. I know the issue is with ISBLANK and with COUNTIF
THE PROBLEM, the piece of code I found that can do this breaks because it is counting the blank cells as not blank because they contain a formula.
I want to take my column of numbers in column B and then sort them numerically in column C.
The code I have so far which works only if the numbers in B are typed in, it breaks if there are blanks generated by a formula
:
=IF(ISERROR(INDEX($B$3:$B$100, MATCH(SMALL(IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), ROW(1:1)), IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), 0))),"",INDEX($B$3:$B$100, MATCH(SMALL(IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), ROW(1:1)), IF(ISBLANK($B$3:$B$100), "", COUNTIF($B$3:$B$100, "<"&$B$3:$B$100)+1), 0))) USE CTRL+SHIFT+ENTER
Assistance on this is greatly appreciated. I know the issue is with ISBLANK and with COUNTIF