+ Reply to Thread
Results 1 to 8 of 8

Trying to COUNTIF when multiple criteria are met on multiple column data set

  1. #1
    Registered User
    Join Date
    04-04-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Trying to COUNTIF when multiple criteria are met on multiple column data set

    I am trying to count the number of emails I receive in a group email box by the time of the day they come in, essentially in 30 minute windows.

    Columns S through CA are each a different date with rows 3 through 400 being the raw data of the time each email came in. Each number indicates a time. Times are listed as a number as I thought it would allow me to work with the data easier in terms of coding. For example 730 equals 7:30. Rows 3 through 199 are AM times and rows 200 through 400 would be PM times. So 730 if in row 3 through 199 would be 7:30am. 730 if in row 200-400 would be 7:30pm.

    So here is what I am trying to do. To see the number of emails that came in from 8am through 8:29am I am trying to do a COUNT that looks for all the numbers that show up in $S$3:$CA$199 that are >=800 and that are <=829.

    So this is basically what I try with no luck. Although I tried many different iterations using nested if statements among other things. I tried putting parentheses around my logic statements and nothing. I'm pulling my hair out.
    =COUNTIFS($S$3:$CA$199,>=$A3,$S$3:$CA$199,<=$B3)
    For PM my code would look like this.
    =COUNTIFS($S$200:$CA$400,>=$A3,$S$200:$CA$400,<=$B3)


    As a side note I'd also like to add a 3rd IF scenario of the date, but that is not necessary yet. My code for that looked like this.
    =COUNTIFS($S$3:$CA$199,>=$A3,$S$3:$CA$199,<=$B3,$S$1:$CA$1,=E$1)

    Also, ideally this code would work for Excel 2003, but I didn't know if I could do what I wanted with that, so I've been playing with Excel 2007.

    Any help would be much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trying to COUNTIF when multiple criteria are met on multiple column data set

    I can't seem to locate the Outlook part of this question. Wrong forum?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-04-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Trying to COUNTIF when multiple criteria are met on multiple column data set

    Yeah, my fault, this should have been excel. Can I move this or does it need to be done by a forum admin?

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Trying to COUNTIF when multiple criteria are met on multiple column data set

    I suppose the Outlook part is because it involves counting e-mails? :-)

    Thread moved

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trying to COUNTIF when multiple criteria are met on multiple column data set

    An xl03 compatible solution would be:

    =SUMPRODUCT(($S$3:$CA$199>=$A3)*($S$3:$CA$199<=$B3))


    However, you really should go back to using actual time. The format you have now is problematic. You're not going to get the answers you want since your method does not differentiate between 1pm and 1am unless you switch to military counting.

    Use regular time values, it's much easier to deal with accurately.

  6. #6
    Registered User
    Join Date
    04-04-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Trying to COUNTIF when multiple criteria are met on multiple column data set

    Thanks, that worked perfectly and I was able to add the necessary code/logic to check for day of the week very easily.

    If we stick with this long term I'll probably manually switch it to actual time, but I think this was just to take a quick look at what times of the day we get emails.

    Thanks again.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trying to COUNTIF when multiple criteria are met on multiple column data set

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  8. #8
    Registered User
    Join Date
    01-15-2011
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    How to get distinct valuess

    Hi

    I need help

    I have data Column 1: A,B,C,D, A, C,M,
    Column 2 : C1,C2, C3, C1, C4, C5,C6
    Coumn3: 1,.5, 1, 1,1,1,1
    Comumn 4: True, False, True, False, False, False, False

    What I want is

    If value of Comumn is A, then how to get distict count of values of Colmun 2

    Seconldy If the value is A, and Colum is 4: how to get sum of Column3

    Can some one help me on this? I need this usig function

    Regads
    kvsree

+ 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