+ Reply to Thread
Results 1 to 6 of 6

Sorting numbers with #div/0! in column

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Sorting numbers with #div/0! in column

    Hi,

    I have some numbers in a column which due to other cells not yet being filled in are returning a supressed #div/0! error. This is fine, but when i go to sort the column it puts them in the wrong order.

    If it helps out any, I would like to record a macro, and assign it to the column header in order to sort the column.

    Thanks
    Last edited by Barking_Mad; 10-20-2009 at 08:23 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,660

    Re: Sorting numbers with #div/0! in column

    Can you uplaod example and clearify how you want them to be ordered!

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting numbers with #div/0! in column

    Hi,

    You don't say what the 'right' order should be. Do you want to ignore the div/0 values, sort them all to the top, or bottom or what?

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Sorting numbers with #div/0! in column

    You can avoid this by nesting your division formula in the IF function and return a value of zero in place of division errors.

    =IF(ISERROR(A2/B2),0,A2/B2)

    You should get correct sort results with a valid number in the cell.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Sorting numbers with #div/0! in column

    Hi,

    Sorry I would like to put all the #div/0! errors below the numbers that are being correctly sorted.

    So it would look like..

    67.54
    45.34
    22.90
    3.76
    2.79
    #div/0!
    #div/0!
    #div/0!

  6. #6
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Sorting numbers with #div/0! in column

    Quote Originally Posted by Palmetto View Post
    You can avoid this by nesting your division formula in the IF function and return a value of zero in place of division errors.

    =IF(ISERROR(A2/B2),0,A2/B2)

    You should get correct sort results with a valid number in the cell.
    Hi, thanks that works just super

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1