+ Reply to Thread
Results 1 to 6 of 6

formula to add a 1 or 0 depending on cell colour

Hybrid View

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    34

    formula to add a 1 or 0 depending on cell colour

    Good day

    I need help with a formula

    the formula must calculate if a 1 or 0 is entered into a yellow or green block and display in the block provided for yellow and green colors, the formula must add all the 1 in all the yellow blocks and all the 1's in the green blocks see attached

    Thanks
    Megan
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: formula to add a 1 or 0 depending on cell colour

    Excel formulas do not see color. You could use VBA to make a User Defined Function or you could use SUBTOTAL combined with Filter (Excel can filter or sort colors from 2007 up)

    So
    =SUBTOTAL(9,$B$2:$B$16)
    Then filter on yellow cells will give you Operations value (enter it in)
    Filtr on Green to give Plant value
    Hope that helps
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: formula to add a 1 or 0 depending on cell colour

    Thank you I will try that

  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,946

    Re: formula to add a 1 or 0 depending on cell colour

    As an alternative, is there a rule or some logic as to why some 's will be green and others yellow? If so, you could use countif() or countifS() based on that to count them?
    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
    10-23-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: formula to add a 1 or 0 depending on cell colour

    this is a type of audit so the site will be scored a 1 or a 0 so the yellow cells are seperate calculations from the green so each color needsto be calculated seperately

  6. #6
    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,946

    Re: formula to add a 1 or 0 depending on cell colour

    could you devise a slightly different scoring method that will differentiate 1 from the other? yellow = A, green = 1?

+ 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