+ Reply to Thread
Results 1 to 11 of 11

Countif formula help please

  1. #1
    Registered User
    Join Date
    09-26-2011
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Countif formula help please

    Hi Excel Forum Members
    I've been struggling with the following problem.

    i'm trying to figure out formulas that will
    1: count how many times a date appears is a set of numbers
    2: add together the values associated with the date

    I hope i've explained it. Ive attached an example and also the table i'm trying to complete. I have manually completed the outcome table but i'm after formulas that will do this work automatically. it is also possible to have h6 and i6 reference g6?

    Thank you in advance
    Callum

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Countif formula help please

    Hello Callum, welcome to the forum. The workbook attachment didn't quite make it. Can you try again?

    You can use

    =countif(B1:B100,A1)

    to count how often the value in A1 is present in the cells B1 to B100.

    =sumif(B1:B100,A1,C1:C100)

    to add all the values from column C where column B equals the value in A1.

    cheers, teylyn

  3. #3
    Registered User
    Join Date
    09-26-2011
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Countif formula help please

    Hi sorry i'll try again with the attachment!

  4. #4
    Registered User
    Join Date
    09-26-2011
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Countif formula help please

    third time is a charm!
    http://www.2shared.com/file/Y34fZJR8/Book1.html

    The trouble i'm having with the countif is i'm searching for a cell containing a date

    Thanks

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Countif formula help please

    Sorry, I won't download anything from an untrusted file sharing site. You can upload a file with the forum tools.

  6. #6
    Valued Forum Contributor
    Join Date
    05-23-2011
    Location
    Lahore PK
    MS-Off Ver
    Excel 2007, 2013
    Posts
    627

    Re: Countif formula help please

    see attatchment
    Attached Files Attached Files
    Azam
    If you want to say Thank you to a member, click the reputation icon (Star) in the left bottom of the post.
    For prompt answer, be descriptive, concise, short, direct, and to-the-point.

  7. #7
    Registered User
    Join Date
    09-26-2011
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Countif formula help please

    Hi Teylyn
    i can't get it to work! but i keep trying

    this is a selection from the date range
    28/02/2011 14:34
    24/02/2011 11:21

    and i'm using this function with g6 refering to a date cell below
    =SUMIF(A2:A24,G6,B2:B24)


    28/02/2011
    24/02/2011

    how can i get the sumif formula to search within the cell contents and disregard the time?

    Thanks
    Cal

  8. #8
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Countif formula help please

    Hi,

    Try this:

    =SUMIF(A2:A24,">="&G6,B2:B24)-SUMIF(A2:A24,">="&(G6+1),B2:B24)
    Hope that helps,

    Colin

    RAD Excel Blog

  9. #9
    Registered User
    Join Date
    09-26-2011
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Countif formula help please

    Hi Guys

    Thank you so much for your help i've got one more question

    if this is my formula

    =COUNTIF(A2:A24,G6)

    If i have a cell H2 contains A2:A24 can i like the formula to look at cell H2 for the range?


    Thanks

  10. #10
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Countif formula help please

    Yes, like this:

    =COUNTIF(INDIRECT(H2),G6)


    But INDIRECT() is volatile so I'm not keen on this.

  11. #11
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Countif formula help please

    Does H2 contain the TEXT value A2:A24?

    If so, you can use

    =COUNTIF(Indirect(H2),G6)

    This is not a very good practice, though, and with a little bit of planning there is probably a better way to achieve the same result. Indirect is volatile and should be avoided.

    cheers,

+ 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