Removing blanks and sorting the list

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
435
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have a column of data (DZ6 to DZ20) from cells with formulas which results in some with data and some with blank cells. The formula below is working for text and sorts the data ascending removing blank cells and places results in cells DZ300 onwards, but I have other column with numeric and blank cell results.
When I use this formula on the numeric cells it results in an error. I'm sure it's something to do with text versus numeric in the code, but can't work it out.
Can anyone advise what I need to change in the formula to remove blanks and sort the cells with data in descending order?
Any help is always appreciated.

=IFERROR(INDEX(DZ$6:DZ$20,MATCH(0,COUNTIF(DZ$6:DZ$20,"<"&DZ$6:DZ$20)-SUM(COUNTIF(DZ$6:DZ$20,DZ$300:DZ301)),0)),"")
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
As you are using 365, how about
Excel Formula:
=SORT(FILTER(DZ6:DZ20,DZ6:DZ20<>""))
 
Upvote 0
Thanks for the above.
Unfortunately it did not work, but it could have been me getting the cells incorrect.
However I did manage to search google and spotted the use of -
=sort(range,1,1)
and because I could use ascending instead of descending it made all the blanks go to the bottom.
Thanks for your help though.
Regards
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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