+ Reply to Thread
Results 1 to 11 of 11

Counting Function

  1. #1
    MAB
    Guest

    Counting Function

    I have a 2500+ line document with different years indicated in column D. How
    would I use the count (??) function to count the number of occurances for
    1998, 1999, 2000, etc?

    The help function isn't very much help to me.

    Thank you.

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    =COUNTIF(D1:D2500=1999) - use the year you want

    Ed

  3. #3
    Bob Phillips
    Guest

    Re: Counting Function

    Type

    =COUNTIF(D1:D2500,1999)

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "EdMac" <[email protected]> wrote in
    message news:[email protected]...
    >
    > =COUNTIF(D1:D2500=1999) - use the year you want
    >
    > Ed
    >
    >
    > --
    > EdMac
    > ------------------------------------------------------------------------
    > EdMac's Profile:

    http://www.excelforum.com/member.php...o&userid=30736
    > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    >




  4. #4
    MAB
    Guest

    Re: Counting Function

    *sigh*

    I regretted to provide information that the dates are formatted as
    dd/mm/yyyy, so the formulas provided to me will not work.

    Is there another way this can be done?

    Sorry for the confusion.

    Thank you.


    "Bob Phillips" wrote:

    > Type
    >
    > =COUNTIF(D1:D2500,1999)
    >
    > --
    >
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from the email address if mailing direct)
    >
    > "EdMac" <[email protected]> wrote in
    > message news:[email protected]...
    > >
    > > =COUNTIF(D1:D2500=1999) - use the year you want
    > >
    > > Ed
    > >
    > >
    > > --
    > > EdMac
    > > ------------------------------------------------------------------------
    > > EdMac's Profile:

    > http://www.excelforum.com/member.php...o&userid=30736
    > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > >

    >
    >
    >


  5. #5
    Kevin Vaughn
    Guest

    Re: Counting Function

    Try:
    =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    --
    Kevin Vaughn


    "MAB" wrote:

    > *sigh*
    >
    > I regretted to provide information that the dates are formatted as
    > dd/mm/yyyy, so the formulas provided to me will not work.
    >
    > Is there another way this can be done?
    >
    > Sorry for the confusion.
    >
    > Thank you.
    >
    >
    > "Bob Phillips" wrote:
    >
    > > Type
    > >
    > > =COUNTIF(D1:D2500,1999)
    > >
    > > --
    > >
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from the email address if mailing direct)
    > >
    > > "EdMac" <[email protected]> wrote in
    > > message news:[email protected]...
    > > >
    > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > >
    > > > Ed
    > > >
    > > >
    > > > --
    > > > EdMac
    > > > ------------------------------------------------------------------------
    > > > EdMac's Profile:

    > > http://www.excelforum.com/member.php...o&userid=30736
    > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > >

    > >
    > >
    > >


  6. #6
    MAB
    Guest

    Re: Counting Function

    This gives me a #VALUE! error message.

    Is there anything else I can try?

    Thank you,

    MAB

    "Kevin Vaughn" wrote:

    > Try:
    > =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    > --
    > Kevin Vaughn
    >
    >
    > "MAB" wrote:
    >
    > > *sigh*
    > >
    > > I regretted to provide information that the dates are formatted as
    > > dd/mm/yyyy, so the formulas provided to me will not work.
    > >
    > > Is there another way this can be done?
    > >
    > > Sorry for the confusion.
    > >
    > > Thank you.
    > >
    > >
    > > "Bob Phillips" wrote:
    > >
    > > > Type
    > > >
    > > > =COUNTIF(D1:D2500,1999)
    > > >
    > > > --
    > > >
    > > > HTH
    > > >
    > > > Bob Phillips
    > > >
    > > > (remove nothere from the email address if mailing direct)
    > > >
    > > > "EdMac" <[email protected]> wrote in
    > > > message news:[email protected]...
    > > > >
    > > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > > >
    > > > > Ed
    > > > >
    > > > >
    > > > > --
    > > > > EdMac
    > > > > ------------------------------------------------------------------------
    > > > > EdMac's Profile:
    > > > http://www.excelforum.com/member.php...o&userid=30736
    > > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > > >
    > > >
    > > >
    > > >


  7. #7
    Kevin Vaughn
    Guest

    Re: Counting Function

    What is in that range other than dates? I tried deleting a date to see if it
    was being caused by blanks. That did not do anything. But when I inserted a
    space in a cell I got the #value error. I am sure that other data could
    cause that error. Like text (you can't perform the year function on text,
    only on dates.)
    --
    Kevin Vaughn


    "MAB" wrote:

    > This gives me a #VALUE! error message.
    >
    > Is there anything else I can try?
    >
    > Thank you,
    >
    > MAB
    >
    > "Kevin Vaughn" wrote:
    >
    > > Try:
    > > =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    > > --
    > > Kevin Vaughn
    > >
    > >
    > > "MAB" wrote:
    > >
    > > > *sigh*
    > > >
    > > > I regretted to provide information that the dates are formatted as
    > > > dd/mm/yyyy, so the formulas provided to me will not work.
    > > >
    > > > Is there another way this can be done?
    > > >
    > > > Sorry for the confusion.
    > > >
    > > > Thank you.
    > > >
    > > >
    > > > "Bob Phillips" wrote:
    > > >
    > > > > Type
    > > > >
    > > > > =COUNTIF(D1:D2500,1999)
    > > > >
    > > > > --
    > > > >
    > > > > HTH
    > > > >
    > > > > Bob Phillips
    > > > >
    > > > > (remove nothere from the email address if mailing direct)
    > > > >
    > > > > "EdMac" <[email protected]> wrote in
    > > > > message news:[email protected]...
    > > > > >
    > > > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > > > >
    > > > > > Ed
    > > > > >
    > > > > >
    > > > > > --
    > > > > > EdMac
    > > > > > ------------------------------------------------------------------------
    > > > > > EdMac's Profile:
    > > > > http://www.excelforum.com/member.php...o&userid=30736
    > > > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > > > >
    > > > >
    > > > >
    > > > >


  8. #8
    MAB
    Guest

    Re: Counting Function

    Hmm, I don't know. I just formatted all the cells where the dates are to
    Date format (mm/dd/yyyy). I even did a text to columns on that column, yet I
    still get the #Value! error.

    Any other thoughts?

    Thanks for all your help so far. :-)


    "Kevin Vaughn" wrote:

    > What is in that range other than dates? I tried deleting a date to see if it
    > was being caused by blanks. That did not do anything. But when I inserted a
    > space in a cell I got the #value error. I am sure that other data could
    > cause that error. Like text (you can't perform the year function on text,
    > only on dates.)
    > --
    > Kevin Vaughn
    >
    >
    > "MAB" wrote:
    >
    > > This gives me a #VALUE! error message.
    > >
    > > Is there anything else I can try?
    > >
    > > Thank you,
    > >
    > > MAB
    > >
    > > "Kevin Vaughn" wrote:
    > >
    > > > Try:
    > > > =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    > > > --
    > > > Kevin Vaughn
    > > >
    > > >
    > > > "MAB" wrote:
    > > >
    > > > > *sigh*
    > > > >
    > > > > I regretted to provide information that the dates are formatted as
    > > > > dd/mm/yyyy, so the formulas provided to me will not work.
    > > > >
    > > > > Is there another way this can be done?
    > > > >
    > > > > Sorry for the confusion.
    > > > >
    > > > > Thank you.
    > > > >
    > > > >
    > > > > "Bob Phillips" wrote:
    > > > >
    > > > > > Type
    > > > > >
    > > > > > =COUNTIF(D1:D2500,1999)
    > > > > >
    > > > > > --
    > > > > >
    > > > > > HTH
    > > > > >
    > > > > > Bob Phillips
    > > > > >
    > > > > > (remove nothere from the email address if mailing direct)
    > > > > >
    > > > > > "EdMac" <[email protected]> wrote in
    > > > > > message news:[email protected]...
    > > > > > >
    > > > > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > > > > >
    > > > > > > Ed
    > > > > > >
    > > > > > >
    > > > > > > --
    > > > > > > EdMac
    > > > > > > ------------------------------------------------------------------------
    > > > > > > EdMac's Profile:
    > > > > > http://www.excelforum.com/member.php...o&userid=30736
    > > > > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > > > > >
    > > > > >
    > > > > >
    > > > > >


  9. #9
    Kevin Vaughn
    Guest

    Re: Counting Function

    Ok, but what else is in that range? For instance D1 might be a heading.
    Also, does it work if you do it on a small range? For instance,

    =SUMPRODUCT(--(YEAR(D3:D210) = 1999))

    If it works on the smaller range, you could try it on progressively larger
    ranges until you get an error and thus locate the source of the problem
    (assuming the formula works for you at all. It is working for me, of course.)
    --
    Kevin Vaughn


    "MAB" wrote:

    > Hmm, I don't know. I just formatted all the cells where the dates are to
    > Date format (mm/dd/yyyy). I even did a text to columns on that column, yet I
    > still get the #Value! error.
    >
    > Any other thoughts?
    >
    > Thanks for all your help so far. :-)
    >
    >
    > "Kevin Vaughn" wrote:
    >
    > > What is in that range other than dates? I tried deleting a date to see if it
    > > was being caused by blanks. That did not do anything. But when I inserted a
    > > space in a cell I got the #value error. I am sure that other data could
    > > cause that error. Like text (you can't perform the year function on text,
    > > only on dates.)
    > > --
    > > Kevin Vaughn
    > >
    > >
    > > "MAB" wrote:
    > >
    > > > This gives me a #VALUE! error message.
    > > >
    > > > Is there anything else I can try?
    > > >
    > > > Thank you,
    > > >
    > > > MAB
    > > >
    > > > "Kevin Vaughn" wrote:
    > > >
    > > > > Try:
    > > > > =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    > > > > --
    > > > > Kevin Vaughn
    > > > >
    > > > >
    > > > > "MAB" wrote:
    > > > >
    > > > > > *sigh*
    > > > > >
    > > > > > I regretted to provide information that the dates are formatted as
    > > > > > dd/mm/yyyy, so the formulas provided to me will not work.
    > > > > >
    > > > > > Is there another way this can be done?
    > > > > >
    > > > > > Sorry for the confusion.
    > > > > >
    > > > > > Thank you.
    > > > > >
    > > > > >
    > > > > > "Bob Phillips" wrote:
    > > > > >
    > > > > > > Type
    > > > > > >
    > > > > > > =COUNTIF(D1:D2500,1999)
    > > > > > >
    > > > > > > --
    > > > > > >
    > > > > > > HTH
    > > > > > >
    > > > > > > Bob Phillips
    > > > > > >
    > > > > > > (remove nothere from the email address if mailing direct)
    > > > > > >
    > > > > > > "EdMac" <[email protected]> wrote in
    > > > > > > message news:[email protected]...
    > > > > > > >
    > > > > > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > > > > > >
    > > > > > > > Ed
    > > > > > > >
    > > > > > > >
    > > > > > > > --
    > > > > > > > EdMac
    > > > > > > > ------------------------------------------------------------------------
    > > > > > > > EdMac's Profile:
    > > > > > > http://www.excelforum.com/member.php...o&userid=30736
    > > > > > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > > >


  10. #10
    MAB
    Guest

    Re: Counting Function

    LOL!

    See, that's why I come here for help. I was including all of column D in
    the formula instead of just including the area where the valid data is.

    I got it to work when I used it correctly.

    Thanks for all your input and patience.

    MAB

    "Kevin Vaughn" wrote:

    > Ok, but what else is in that range? For instance D1 might be a heading.
    > Also, does it work if you do it on a small range? For instance,
    >
    > =SUMPRODUCT(--(YEAR(D3:D210) = 1999))
    >
    > If it works on the smaller range, you could try it on progressively larger
    > ranges until you get an error and thus locate the source of the problem
    > (assuming the formula works for you at all. It is working for me, of course.)
    > --
    > Kevin Vaughn
    >
    >
    > "MAB" wrote:
    >
    > > Hmm, I don't know. I just formatted all the cells where the dates are to
    > > Date format (mm/dd/yyyy). I even did a text to columns on that column, yet I
    > > still get the #Value! error.
    > >
    > > Any other thoughts?
    > >
    > > Thanks for all your help so far. :-)
    > >
    > >
    > > "Kevin Vaughn" wrote:
    > >
    > > > What is in that range other than dates? I tried deleting a date to see if it
    > > > was being caused by blanks. That did not do anything. But when I inserted a
    > > > space in a cell I got the #value error. I am sure that other data could
    > > > cause that error. Like text (you can't perform the year function on text,
    > > > only on dates.)
    > > > --
    > > > Kevin Vaughn
    > > >
    > > >
    > > > "MAB" wrote:
    > > >
    > > > > This gives me a #VALUE! error message.
    > > > >
    > > > > Is there anything else I can try?
    > > > >
    > > > > Thank you,
    > > > >
    > > > > MAB
    > > > >
    > > > > "Kevin Vaughn" wrote:
    > > > >
    > > > > > Try:
    > > > > > =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    > > > > > --
    > > > > > Kevin Vaughn
    > > > > >
    > > > > >
    > > > > > "MAB" wrote:
    > > > > >
    > > > > > > *sigh*
    > > > > > >
    > > > > > > I regretted to provide information that the dates are formatted as
    > > > > > > dd/mm/yyyy, so the formulas provided to me will not work.
    > > > > > >
    > > > > > > Is there another way this can be done?
    > > > > > >
    > > > > > > Sorry for the confusion.
    > > > > > >
    > > > > > > Thank you.
    > > > > > >
    > > > > > >
    > > > > > > "Bob Phillips" wrote:
    > > > > > >
    > > > > > > > Type
    > > > > > > >
    > > > > > > > =COUNTIF(D1:D2500,1999)
    > > > > > > >
    > > > > > > > --
    > > > > > > >
    > > > > > > > HTH
    > > > > > > >
    > > > > > > > Bob Phillips
    > > > > > > >
    > > > > > > > (remove nothere from the email address if mailing direct)
    > > > > > > >
    > > > > > > > "EdMac" <[email protected]> wrote in
    > > > > > > > message news:[email protected]...
    > > > > > > > >
    > > > > > > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > > > > > > >
    > > > > > > > > Ed
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > --
    > > > > > > > > EdMac
    > > > > > > > > ------------------------------------------------------------------------
    > > > > > > > > EdMac's Profile:
    > > > > > > > http://www.excelforum.com/member.php...o&userid=30736
    > > > > > > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > > > > > > >
    > > > > > > >
    > > > > > > >
    > > > > > > >


  11. #11
    Kevin Vaughn
    Guest

    Re: Counting Function

    Glad you got it working.
    --
    Kevin Vaughn


    "MAB" wrote:

    > LOL!
    >
    > See, that's why I come here for help. I was including all of column D in
    > the formula instead of just including the area where the valid data is.
    >
    > I got it to work when I used it correctly.
    >
    > Thanks for all your input and patience.
    >
    > MAB
    >
    > "Kevin Vaughn" wrote:
    >
    > > Ok, but what else is in that range? For instance D1 might be a heading.
    > > Also, does it work if you do it on a small range? For instance,
    > >
    > > =SUMPRODUCT(--(YEAR(D3:D210) = 1999))
    > >
    > > If it works on the smaller range, you could try it on progressively larger
    > > ranges until you get an error and thus locate the source of the problem
    > > (assuming the formula works for you at all. It is working for me, of course.)
    > > --
    > > Kevin Vaughn
    > >
    > >
    > > "MAB" wrote:
    > >
    > > > Hmm, I don't know. I just formatted all the cells where the dates are to
    > > > Date format (mm/dd/yyyy). I even did a text to columns on that column, yet I
    > > > still get the #Value! error.
    > > >
    > > > Any other thoughts?
    > > >
    > > > Thanks for all your help so far. :-)
    > > >
    > > >
    > > > "Kevin Vaughn" wrote:
    > > >
    > > > > What is in that range other than dates? I tried deleting a date to see if it
    > > > > was being caused by blanks. That did not do anything. But when I inserted a
    > > > > space in a cell I got the #value error. I am sure that other data could
    > > > > cause that error. Like text (you can't perform the year function on text,
    > > > > only on dates.)
    > > > > --
    > > > > Kevin Vaughn
    > > > >
    > > > >
    > > > > "MAB" wrote:
    > > > >
    > > > > > This gives me a #VALUE! error message.
    > > > > >
    > > > > > Is there anything else I can try?
    > > > > >
    > > > > > Thank you,
    > > > > >
    > > > > > MAB
    > > > > >
    > > > > > "Kevin Vaughn" wrote:
    > > > > >
    > > > > > > Try:
    > > > > > > =SUMPRODUCT(--(YEAR(D1:D2500) = 1999))
    > > > > > > --
    > > > > > > Kevin Vaughn
    > > > > > >
    > > > > > >
    > > > > > > "MAB" wrote:
    > > > > > >
    > > > > > > > *sigh*
    > > > > > > >
    > > > > > > > I regretted to provide information that the dates are formatted as
    > > > > > > > dd/mm/yyyy, so the formulas provided to me will not work.
    > > > > > > >
    > > > > > > > Is there another way this can be done?
    > > > > > > >
    > > > > > > > Sorry for the confusion.
    > > > > > > >
    > > > > > > > Thank you.
    > > > > > > >
    > > > > > > >
    > > > > > > > "Bob Phillips" wrote:
    > > > > > > >
    > > > > > > > > Type
    > > > > > > > >
    > > > > > > > > =COUNTIF(D1:D2500,1999)
    > > > > > > > >
    > > > > > > > > --
    > > > > > > > >
    > > > > > > > > HTH
    > > > > > > > >
    > > > > > > > > Bob Phillips
    > > > > > > > >
    > > > > > > > > (remove nothere from the email address if mailing direct)
    > > > > > > > >
    > > > > > > > > "EdMac" <[email protected]> wrote in
    > > > > > > > > message news:[email protected]...
    > > > > > > > > >
    > > > > > > > > > =COUNTIF(D1:D2500=1999) - use the year you want
    > > > > > > > > >
    > > > > > > > > > Ed
    > > > > > > > > >
    > > > > > > > > >
    > > > > > > > > > --
    > > > > > > > > > EdMac
    > > > > > > > > > ------------------------------------------------------------------------
    > > > > > > > > > EdMac's Profile:
    > > > > > > > > http://www.excelforum.com/member.php...o&userid=30736
    > > > > > > > > > View this thread: http://www.excelforum.com/showthread...hreadid=504479
    > > > > > > > > >
    > > > > > > > >
    > > > > > > > >
    > > > > > > > >


+ 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