+ Reply to Thread
Results 1 to 4 of 4

how to count dates and divide in years

Hybrid View

DMR1712 how to count dates and divide... 07-15-2010, 06:45 AM
NBVC Re: how to count dates and... 07-15-2010, 07:55 AM
Marcol Re: how to count dates and... 07-15-2010, 08:14 AM
DMR1712 SOLVED: Re: how to count... 07-16-2010, 02:46 AM
  1. #1
    Registered User
    Join Date
    09-20-2009
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    18

    how to count dates and divide in years

    Hello everyone,

    I have a list of dates in 2009 and 2010, which are mixed together (and should stay that way). I would like to count how many dates are entered and divide them into 2009 dates and 2010 dates.

    I know there's a formula called COUNT which counts the number of dates, but how do I divide them into different years? To make it a little more complicated: The dates are spread over 2 sheets (in the same file, don't worry), so I think it should be something like:

    COUNT (#NAMESHEET1(A:A)) + COUNT( #NAMESHEET2(A:A))

    and somehow divide in 2009 and 2010...

    can anyone help me with this? Thanks in advance!
    Last edited by DMR1712; 07-16-2010 at 02:47 AM. Reason: solved!

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

    Re: how to count dates and divide in years

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    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
    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: how to count dates and divide in years

    Maybe, assuming your dates are in column A on both sheets

    for 2009 total
    =SUMPRODUCT((YEAR(Sheet1!$A:$A)=2009)*1)+SUMPRODUCT((YEAR(Sheet2!$A:$A)=2009)*1)

    and for 2010
    =SUMPRODUCT((YEAR(Sheet1!$A:$A)=2010)*1)+SUMPRODUCT((YEAR(Sheet2!$A:$A)=2010)*1)

    Adjust sheet names and column refs to suit.

    Hope this helps
    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.

  4. #4
    Registered User
    Join Date
    09-20-2009
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    18

    Thumbs up SOLVED: Re: how to count dates and divide in years

    Hi Marcol,

    Thanks a million! it worked like a charm. Found out that I had to change it a bit to be able to use it in openoffice, so the final version became:

    =SUMPRODUCT((YEAR(Sheet1.D2:Sheet1.D1000)=2009)*1)+SUMPRODUCT((YEAR(Sheet2.D2:Sheet2.D1000)=2009)*1)
    Thanks again!
    DMR

+ 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