+ Reply to Thread
Results 1 to 10 of 10

Formula for Conditional Formatting Bottom 5 excluding 0's

Hybrid View

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Utah
    MS-Off Ver
    Office 365
    Posts
    30

    Formula for Conditional Formatting Bottom 5 excluding 0's

    Hey everyone!

    I'm trying to use Conditional Formatting on a group of cells that include balances, and some that have just letters/place fillers (XXXX) in them.

    I can't get the "Bottom 5" to work because it uses the 0's. I've tried a few formula's and have been unsuccessful.

    Here is my sad attempt:

    =SMALL(IF(E$3:E$26>0,E$3:E$26)E$3:E$26,5)

    I know something isn't right, and I can't quite figure out how to make it work. If I only use this below...

    =MIN(IF(E$3:E$26>0,E$3:E$26))

    ....I can get it do format the minimum value that is not 0 of all the cells. I sadly cannot figure how to combine them. I like the Bottom 5, but I also wonder if there is a way to use the Data Bar with formula in this instance?

    Thanks!
    Last edited by FlyinIron406; 05-08-2013 at 09:38 PM.

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    maybe like this

    =AND($E3<SMALL(IF(E$3:E$26>0,E$3:E$26),6),$E3>0)
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    05-08-2013
    Location
    Utah
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    Hey Vlady,

    Thanks for the reply. I have put your formula in the Conditional Formatting > Classic > Use a formula to format > box. It didn't seem to work. It only formatted 2 cells, one of which was the 3rd from the bottom and a cell with a zero in it. Is having the XXXXX place fillers creating a problem you think?

    Thanks!

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    maybe you should provide a sample on the workbook you are working.

    To Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    05-08-2013
    Location
    Utah
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    Hey,

    Thanks. I have attached the following, that gives an idea. For some reason, the code you provided works on this sample data! Yet, not on my actual log. On my actual workbook, all of the numbers are pulled from a separate sheet, and the formatting is >0 red, <= green, with US currency. I am not sure that the data being pulled from another spot matters or not?

    Thanks!
    Attached Files Attached Files

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    how did you pull the data. what did you use?

  7. #7
    Registered User
    Join Date
    05-08-2013
    Location
    Utah
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    Thanks for your patience and help!

    The data in this column is pulled from an entry sheet in the same workbook. Just another worksheet. I pull the data using the [ = ] sign and then browsing to that sheet, selecting the cell, and hitting enter.

  8. #8
    Registered User
    Join Date
    05-08-2013
    Location
    Utah
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    Okay,

    I may have narrowed it down to the Conditional Formatting of the numbers based on value. In this new sample, you can see how I have my actual doc formatted. >.01 is red, < .001 or whatever is green. I also have the formula format you kindly provided too.

    So, based on your code, without the Conditional for Red and Green, it works great. The second I add that formatting, it does not work again.

    Thanks for any info and insight you can provide.
    Attached Files Attached Files

  9. #9
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    look attachment.

    Copy of sample2.xlsx

  10. #10
    Registered User
    Join Date
    05-08-2013
    Location
    Utah
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Formula for Conditional Formatting Bottom 5 excluding 0's

    Wow vlady,

    This seems to work great! I hope it wasn't too much effort, as I am completely lost when I go through the code!

    A few things to add, or I'm curious about:
    1. If only one cell has a positive number, it will be black and not formatted red. I am unsure what value to change! If it is 0 or negative it formats correctly.
    2. Now, this isn't a biggie by any means. Would it be possible to have it use the custom format fill it does on the 5 lowest, apply to the next 3 cells adjacent?
    Ex: If cell E15 is one of the 5 lowest, and is filled, F15 (amt due), G15 (extra), and H15 (total paid) would also fill?

    Thank you SO MUCH for your help! Amazing

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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