+ Reply to Thread
Results 1 to 10 of 10

Permanently sort a Col depending on Colour

  1. #1
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Permanently sort a Col depending on Colour

    Hello,

    Please see the attached for more information.

    In Col A (current layout) every cell that contains a 1 has conditional formatting 'cell that contains..' 1 and turns red. I want every cell that is red to be grouped at the top of my page like Col D / E.

    I am hoping for a formula that sorts the information as per Col D / E.

    The information in Col A/B will be changing on a daily basis and I do not want to keep having to use the 'sort' function every single time to get my desired D / E look.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: Permanently sort a Col depending on Colour

    So the values dont need to be sorted, sicne you havent sorted them, you simply want red at the top (in any order) and then non-red.

    in row D2
    =IFERROR(INDEX($A$2:$B$24,AGGREGATE(15,6,ROW($A$2:$A$24)/((ISNUMBER((SEARCH("1",A$2:A$24))))),ROWS(A$2:A2))-(2-1),COLUMN()-3),"")
    copy to E2
    and copy down for as many rows as you have in column A
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: Permanently sort a Col depending on Colour

    Hello,

    I might be missing something, it's simply returning the attached
    Attached Files Attached Files
    Last edited by batexcel; 06-11-2019 at 10:28 AM.

  4. #4
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: Permanently sort a Col depending on Colour

    but yes, simply red followed by non red

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: Permanently sort a Col depending on Colour

    Ah, now I've tested it, it will simply return the values in red, not the others though it does return the actual values, ie I'm not getting a 0 at all.

    Either try again (it does work) or post the file where you're getting 0.

  6. #6
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: Permanently sort a Col depending on Colour

    Hello, I am attached above, I did something wrong - not returning 0 - but simply returning red values

  7. #7
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: Permanently sort a Col depending on Colour

    No, my mistake, as above this will only return red values, I dont think this solution will work

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Permanently sort a Col depending on Colour

    Please try at D2:E25

    =IF($A2<>"",INDEX(A:A,IFERROR(AGGREGATE(15,6,ROW($A$2:$A$99)/ISNUMBER(FIND(1,$A$2:$A$99)),ROWS(D$2:D2)),AGGREGATE(15,6,ROW($A$2:$A$99)/ISERROR(FIND(1,$A$2:$A$99)),ROWS(D$2:D2)-COUNT(INDEX(FIND(1,$A$2:$A$99),))))),"")

    or just sort on cell color, selcet A2 >Ribbon Data > sort and set as below
    sort.jpg

  9. #9
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: Permanently sort a Col depending on Colour

    Thank you!
    Attached Files Attached Files
    Last edited by batexcel; 06-11-2019 at 10:56 AM.

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Permanently sort a Col depending on Colour

    Please see attached.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Won't permanently sort properly
    By GigaFluxx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2015, 11:32 AM
  2. Changing Colour of one cell depending on value of another
    By jaarons in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-12-2012, 10:28 AM
  3. Fill cells depending on colour?
    By Mattneedshelp in forum Excel General
    Replies: 1
    Last Post: 04-23-2012, 11:00 AM
  4. VBA Colour Row depending on the value of a cell
    By ottax0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2011, 06:37 AM
  5. Format a specific cells background colour permanently
    By hermithead in forum Excel General
    Replies: 3
    Last Post: 10-12-2009, 11:18 PM
  6. Changing colour depending on value
    By Paul Cooke in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-01-2007, 11:23 PM
  7. [SOLVED] Changing Colour of Bar depending on Value
    By Campbell in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-31-2006, 08:20 AM

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