+ Reply to Thread
Results 1 to 7 of 7

Countif or Sumif based on Conditional Formatting Color

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, California, United States of America
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    4

    Countif or Sumif based on Conditional Formatting Color

    Hey everybody,

    I need a way to count the number of boxes in a row that have a fill of red(conditional formatting).

    I've done some research and have found that I need to use the same logic that created the fill if I want to count that box with countif. My only problem is that the cell fill is based on two conditions.

    Condition 1) Cell Value is, =0, No Format Set

    Condition 2) Formula is, =AND($Y$54<$X$54), Format Fill Red

    I've added a sample.xslx file to help describe what I'm looking for.

    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Countif or Sumif based on Conditional Formatting Color

    in H4

    =COUNTIF(E4:G4,1)

    copy down

    in H22

    =MAX(H4:H14)

  3. #3
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, California, United States of America
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    4

    Re: Countif or Sumif based on Conditional Formatting Color

    Hi dwint,

    Thanks for replying.

    Question: Wouldn't that formula also count the teams that particular person (row) has picked for the loosing team?

    I use 1 to denote which team each person has chosen to win the game. It is my intention for these fields to be filled out prior to applying the game score so I don't have to do any work in deciding who won the pool for the week other than entering game scores. =)

    Again, thanks for replying to my post.

    Kune

  4. #4
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Countif or Sumif based on Conditional Formatting Color

    basickly, i dont know the rule of your game and i dont know what does the meaning of "Atl, Dal, TB, and SD", because it might be never played in my country

    I just post the answer based on your logic which you have written in your sample.

  5. #5
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, California, United States of America
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    4

    Re: Countif or Sumif based on Conditional Formatting Color

    Atl Dal TB all refer to american football teams.

    That has no significance with what I intend. I am just looking for a way to count only those cells that are colored red.

    So, if a person picks the winning team that cell will turn red. At the end of it all, I need to know who picked the most winning teams.

    I hope that helps.

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Countif or Sumif based on Conditional Formatting Color

    Why not try something a bit more simple if all you are trying to do is figure out who had the most winning picks each week... I have attached your original file, with a second sheet set up a bit differently. Hope it solves your issue.

    - Vince
    Attached Files Attached Files
    Last edited by Moo the Dog; 10-07-2012 at 12:17 AM.

  7. #7
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, California, United States of America
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    4

    [SOLVED]Re: Countif or Sumif based on Conditional Formatting Color

    Hey Vince,

    Actually that's very helpful! Thank you!

    I used your logic for how to show who picked which team and I've totaled the number of people that picked the winning team at the bottom. Now I'm attempting to sumproduct a row.

    Check this out.

    Sample-Modified.xlsx
    Last edited by Kune; 10-07-2012 at 02:38 AM. Reason: Resolved

  8. #8
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Countif or Sumif based on Conditional Formatting Color

    Kune,

    In your updated example, column 'J' was returning the wrong total due to blank cells in the span (D6:I6) - it's best not to use merged or 'span across multiple column' cells in formulas, since output formulas that rely on those cells have to be unnecessarily adjusted.

    Regardless, I have adjusted the formula in cell J6 to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You can paste that into cell J6, then fill down. It should give you the correct totals then. Basically, it is the same SUMPRODUCT formula you had, except I added a COUNTBLANK operator to deduct the number of blank cells in the span.

    Also... be sure you use the proper reference models in your formulas. ex: Use (D6:I6=$D$4:$I$4) instead of (D6:I6=D4:I4) since you want the reference row (winning team) to remain constant.

    Glad I could help.

    - Vince

+ 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