+ Reply to Thread
Results 1 to 4 of 4

CountIf Problems

  1. #1
    Registered User
    Join Date
    07-07-2011
    Location
    Norman, OK
    MS-Off Ver
    Excel 2003
    Posts
    1

    CountIf Problems

    So this is a little strange and I am having difficulty figuring out how to calculate these numbers. I have multiple sheets with active dates on them under this code:

    =(IF(J18="",0,DATEDIF(J18,TODAY(),"md")&" days , "&DATEDIF(J18,TODAY(),"ym")&" months, "&DATEDIF(J18,TODAY(),"y")&" years

    This gives me a current break down of months days and years a project is running in a single cell.

    Then on a different sheet I want a running total of the projects that are 0-2 months old, 3-5 months old, 6-8 months old, 9-11 months old, and then a year and older. So I did this formula for counting one of the months.

    =+SUM(COUNTIF(January!N17:N4010,"*6 months*") which works great, the problem is if something is 1 year and 6 months old or 2 years and 6 months old it is also counted in this number. Is there a way I can just calculate the ones that are 6 months and not those that are 1 year and 6 months etc.

    Thanks
    Jason

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CountIf Problems

    Perhaps:

    =COUNTIF(January!N17:N4010,"*6 months*0 years")

    Note: the +SUM() is redundant and not necessary.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-29-2010
    Location
    Central Texas
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: CountIf Problems

    NBVC.

    Just a quick question, wouldn't that also pick-up 10 years, 20 years,.....
    Maybe:
    =COUNTIF(January!N17:N4010,"*6 months, 0 years")
    would work?
    Harley2

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: CountIf Problems

    Good point Harley2. You are correct... although I am not sure how the OP will get all other combinations...

    probably better to have another column in the main data that actual calculated the difference in dates and then use countif to determine greater than and/or less than certain number of days.... (i.e. for 6 months... 180 days)

+ 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