+ Reply to Thread
Results 1 to 10 of 10

Conditional formatting using IF and SUM

  1. #1
    Registered User
    Join Date
    11-28-2018
    Location
    Oconomowoc, Wisconsin
    MS-Off Ver
    10
    Posts
    3

    Conditional formatting using IF and SUM

    Need help with conditional formatting for the following: IF the sum of a2 thru a6 is > a1, format cells a2 thru a6 that contain numbers (with the ‘bad style’ (or pink fill with red font). Is this even possible?

  2. #2
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Conditional formatting using IF and SUM

    Yes of course it is possible.

    In A2 conditional format formula:

    =SUM(A2:A6)>A1

    Format the fill as you need.

    Then edit the rule and change the range to the other cells.

    I hope that helps,
    XJ

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,577

    Re: Conditional formatting using IF and SUM

    Select cells A2:A6 and use the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Choose your colours as you wish.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    11-28-2018
    Location
    Oconomowoc, Wisconsin
    MS-Off Ver
    10
    Posts
    3

    Re: Conditional formatting using IF and SUM

    I see how this works! now the next step - what if I only want to format the cells a2 - a6 that actually contain a value?

  5. #5
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Conditional formatting using IF and SUM

    =and(a2<>"",sum($a$2:$a$6)>$a$1)

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,577

    Re: Conditional formatting using IF and SUM

    OK, that would be the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note that it is $A2, NOT $A$2

  7. #7
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: Conditional formatting using IF and SUM

    Removed thanks
    Last edited by xjohnson; 11-28-2018 at 05:10 PM.

  8. #8
    Registered User
    Join Date
    11-28-2018
    Location
    Oconomowoc, Wisconsin
    MS-Off Ver
    10
    Posts
    3

    Re: Conditional formatting using IF and SUM

    You rock! Thank you so very much!!!

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,577

    Re: Conditional formatting using IF and SUM

    @xjohnson
    You win
    Not sure who that is aimed at.

    We seem to have provided much the same solutions. However, the first stage can be completed in one step by selecting the whole range and using the formula for the first cell, rather than copying and pasting the CF. Second part, I just prefer to use absolute references unless the CF is being dragged across columns.

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,577

    Re: Conditional formatting using IF and SUM

    @megmad: You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. [SOLVED] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  2. Replies: 1
    Last Post: 12-08-2016, 03:14 PM
  3. Conditional Formatting Removing Previous Conditional Formatting?
    By CravingGod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 01:02 PM
  4. Replies: 6
    Last Post: 01-08-2016, 06:44 PM
  5. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  6. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 PM

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