+ Reply to Thread
Results 1 to 14 of 14

counting based on conditional format

  1. #1
    Registered User
    Join Date
    12-29-2005
    Posts
    90

    counting based on conditional format

    hi hope theres a way to do this.

    i have a spreadsheet which is used to keep the training records for the company it counts no of staff and their skill levels for different parts of the job, when a person moves to a different branch the skill required changes and they have a set period of time to aquire the new skill.

    when the time is up the colour of the old skill is changed to a red font by a conditional format based on the date.this is then counted by a calculation so the team know how many people are to be targeted for extra training.

    the problem i have is the calculation will not count conditionally formated cells, so whenever i update the sheet i have to go to each cell with red text and change the font colour manually to red, this sounds really silly and is impossible to explain to anyone who does not understand conditional formatting. i e the people who will end up using the database

    what im looking for is a way to count conditionally formatted cells based on the condition being met i.e. they are showing as red font.

    can it be done and how?
    or am i wasting my time looking for an answer to something excel wont do ?

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    May be this link will help?

    http://www.xldynamic.com/source/xld.ColourCounter.html
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    already been there, if you read through about 3/4 way down the page there are a couple of constraints, the one that concerns me i've copied below

    "The second shortcoming is that this technique at present does not cater for cells that are coloured due to conditional formatting"

    the result being that this will do what i already have in use but not what i'm trying to achieve.

    thanks for the link anyway, couple of things in there that may be useful in the future

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    This thread may help you

    http://www.excelforum.com/showthread.php?t=601773

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    this looks like what i need but i cant get it to work, i've copied the code in and set up a formula to call it but all i get is #value!. the formula im using is =sumbycfcolorindex(h11:h91,1). i've tried changing the last value as advised on the article but just get the same result. what am i doing wrong(PROBABLY SOMETHING SIMPLE)

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Just a thought reading through this again, instead of counting coloured cells can't you count based on a date of change, so that you count cells after a particular date?

    Without seeing a sample of your worksheet, it's difficult to see what exactly you are trying to do.

  7. #7
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    I think I am just expounding on oldchippy's idea. Why not just count BASED on the condition. For example, if the cell's font changes to red if the current date is 30 days after the date in the cell, your conditional format may look something like:

    =A2>TODAY()+30 (or something like that)

    In that case, just set up a COUNT IF type array:

    =SUMPRODUCT(--(A2>TODAY()+30))

  8. #8
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    dont know if these would work but attached a cut down version of the workbook so you can see what im trying to do hope you can suggest something
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517
    I agree with BigBas

    You seem to be setting the colour of a cell based on a condition (which gives a logical value) then trying to count the coloured cells.

    Why can't you count the number of cells that match the same condition that you use in the conditional format using COUNTIF() (or similar)?

    for example:

    =countif(A2:D256,">"&E22)

    where A2:D256 is the array of dates to be checked, E22 is the date beyond which the condition changes.

  10. #10
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    that appears to assume the date is always the same. this is not the case, the date changes for each entry and the calculation cant go in the target cells as they already contain needed information

  11. #11
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    How about,

    =COUNTIF($Q$11:$Q$23,"<"&TODAY())

    Result = 3, which is what you have got - 3 RED "CHANGE"

  12. #12
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    tried this and got the result you said, 3 but on all 4 columns the same result whereas the 4 columns H,I,J,K all need to total individually so the actual result i would need on the sample posted would be H=0, I=3, J=0, K=0

  13. #13
    Registered User
    Join Date
    12-29-2005
    Posts
    90
    thanks for all your help but happy to report that i've solved the problem by coming at it backwards, i re wrote the conditional format to infill the cells in green then just instructed the user to change the text colour of any green cells to red, the thing that was confusing them was having to change the text to red when(as far as they could see) it was already red

    thanks again

  14. #14
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Glad to hear you've got a result - thanks for the feedback

+ 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