+ Reply to Thread
Results 1 to 9 of 9

counting number of cells which meet a certain criteria

  1. #1
    Registered User
    Join Date
    11-30-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    counting number of cells which meet a certain criteria

    I have a spreadsheet that tracks when an item is received within the department and then when it is dealt with. If the item is not dealt with within 45mins it turns amber, 1 hour the cell will turn red, when it has been dealt with the cell turns green. I need to count how many cells are red and have a total at the top of the sheet, I dont really know enough about VBA to even try that but thought that I could do a formula that counts the cells with a set criteria. My conditional formatting for cells is:-

    GREEN CONDITIONAL FORMAT =LEN($H3)>0

    RED CONDITIONAL FORMAT =AND(ISBLANK($H3),$G3+ TIME(1,0,0)<NOW()-TODAY(),LEN($G3)>0)

    AMBER CONDITIONAL FORMAT =AND(ISBLANK($H3),$G3 + TIME(0,45,0)<NOW()-TODAY(),LEN($G3)>0)

    Have tried a few attempts but cant seem to get the criteria correct.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: counting number of cells which meet a certain criteria

    Hi Laurab,

    Suggest you to upload a sample workbook.. thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: counting number of cells which meet a certain criteria

    Hi There,

    I dont have the workbook and Im assuming the you would need the count from column H.

    try the below formula


    Please Login or Register  to view this content.
    Or try uploading a sample workbook
    Thanks,

    Bonny Tycoon


  4. #4
    Registered User
    Join Date
    11-30-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: counting number of cells which meet a certain criteria

    Hi

    Sample spreadsheet attached.

    thanks
    Attached Files Attached Files

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: counting number of cells which meet a certain criteria

    I need to count how many cells are red
    You can have now() function and today() somewhere in the spreadsheet and then you can use the countif function to count the cells which meets Criteria for Red - to count how many cells are red..

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  6. #6
    Registered User
    Join Date
    11-30-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: counting number of cells which meet a certain criteria

    I tried that but didnt seem to work, have uploaded a sample workbook.

    Thanks

  7. #7
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: counting number of cells which meet a certain criteria

    Hi Laurab,

    You would need a supporting column or a helper column to derive your figure. I have added a helper column (you can hide it if you need your sheet to look more neat )

    Check this out.. LB_tracker1.xls

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: counting number of cells which meet a certain criteria

    Try using your C/F formulae applied to SUMPRODUCT()
    e.g. Red condition
    Please Login or Register  to view this content.
    See this workbook
    Attached Files Attached Files
    Last edited by Marcol; 06-19-2012 at 07:12 AM. Reason: Added Attachment
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Registered User
    Join Date
    11-30-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: counting number of cells which meet a certain criteria

    Thats brilliant it worked, thanks.

+ 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