+ Reply to Thread
Results 1 to 6 of 6

Conditional Format - adding several data cells for one condition

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Washington
    MS-Off Ver
    Excel 2007
    Posts
    11

    Conditional Format - adding several data cells for one condition

    Hello. I am trying to use conditional formatting and combine the value of three cells, and based on the total of the cells, highlight all the cells with a fill color. Example:

    A4 = 450
    A6 = 150
    A8 = 350

    If the total of the cells is greater than 700, then I want all cells to be highlighted in red. If the total value of the cells is less than 300, then I want all cells to be highlighted with green. If the total value is between 301 and 699, then I want all the cells to be highlighted with yellow. (There is a reason for no data being in cells A5 and A7 - these are blank and will always be blank)

    I tried using a formula "=SUM(A4:A8)>700" for one condition, but the result is cell A4 is the only cell highlighted with red. What formula (or formula's) do I use so all three cells are highlighted?

    Thanks!

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Conditional Format - adding several data cells for one condition

    "=SUM($A$4:$A$8)>700" If you look at the other cell's conditional formats, they will probably have different ranges as your formula is relative, not absolute.
    Frob first, tweak later

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    Washington
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Format - adding several data cells for one condition

    Thanks Neil. I'm not sure what you mean by "relative" versus "absolute." And how would I change my formula to reflect an absolute change? Thanks!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Conditional Format - adding several data cells for one condition

    Hi and welcome to the forum

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =sum(A4:A8)>700 format fill red
    repeat 3&4 with =sum(A4:A8)<300
    repeat 3&4 with =and(sum(A4:A8)>=300,sum(A4:A8)<=700)

    you state that you want it less than 300, greater than 700, and from 301 to 699 - what about exactly 300 and 700? I included the >=300 and <=700 onthe 3rd rule, move it to where you want it

    let me know how you make out please?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    04-25-2013
    Location
    Washington
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Format - adding several data cells for one condition

    Thank you - the first cell (450) is highlighted in red while the other two cells are highlighted in yellow. (And I used your "greater than" and "less than" rules as those are truly what I'm looking for.)

  6. #6
    Registered User
    Join Date
    04-25-2013
    Location
    Washington
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Format - adding several data cells for one condition

    This is SOLVED!

    I used an IF statement to solve my problem. I eventually used "=IF(A4+A6+A8>700,1,"")".

    Thanks everyone!

+ 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