+ Reply to Thread
Results 1 to 3 of 3

Sum if cells match a colour based on conditional formatting

  1. #1
    Registered User
    Join Date
    08-07-2018
    Location
    Brighton, England
    MS-Off Ver
    O365
    Posts
    21

    Sum if cells match a colour based on conditional formatting

    Hey Guys,

    Looking for help with totalling a column of where the cells have been changed to a different colour based on their conditional formatting.
    • The results need to show in the tab named "strikes", "repeat captain" column.
    • The total number needs to come from the tab named "captains", "points" column if coloured red by the conditional formatting.

    I took a vba module from a post i had found on a google search, that is within the tab "macro 1" however i'm not sure if that is the way to go...

    As always, your help is very much appreciated!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Sum if cells match a colour based on conditional formatting

    The font color from conditional formatting is not the same as a cell's .Font.color in VBA.

    The easier way to do it is to use a formula that uses the same condition as in your Conditional Formatting rule.

    =SUMPRODUCT((Captains!$B$3:$B$35=Captains!$B$4:$B$36)*Captains!$C4:$C$36)
    Or
    =SUMIF(Captains!$B$3:$B$35,Captains!$B$4:$B$36,Captains!$C4:$C$36)
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-07-2018
    Location
    Brighton, England
    MS-Off Ver
    O365
    Posts
    21

    Re: Sum if cells match a colour based on conditional formatting

    Thank you AlphaFrog, the SumProduct worked perfectly! Really appreciate your support

+ 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. conditional formatting fill cells based on text, how to find sum based on CF colour
    By tubbybear in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-27-2016, 12:04 PM
  2. Replies: 5
    Last Post: 11-14-2015, 10:20 AM
  3. Help doing conditional formatting based on size cell to colour other cells
    By Craigsim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2015, 06:09 AM
  4. Count Cells Based on Colour Determined by Conditional Formatting
    By RanCanMan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2015, 09:45 AM
  5. [SOLVED] Conditional Formatting: Comparing Multiple Cells & Highlighting Based On Colour
    By WorkWear in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-28-2015, 10:47 AM
  6. Count blank cells by colour based on conditional formatting
    By mb0202 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-03-2013, 07:37 AM
  7. [SOLVED] Conditional Formatting (?) based upon another cells colour
    By bellevue in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-09-2012, 04:27 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