+ Reply to Thread
Results 1 to 4 of 4

Please help with Countif function

  1. #1
    Registered User
    Join Date
    01-08-2005
    Posts
    4

    Unhappy Please help with Countif function


    Row Col C Col D
    1 Level 2 6:30 Pm
    2 Level 1 12:30 Pm
    3 Level 2 12:30 Pm
    4 Level 1 6:30 Pm
    5 Level 1 12:30 Pm
    6 Level 2 6:30 Pm



    I need to create a function as follows where both conditions must be true, however the second argument is not being picked up. I have reformatted this function every way I could think of resulting in either a format error or invalid results.

    =COUNTIF(C1:C6,”Level 1”)and(D1:D6,”12:30 Pm”)

    Expected results: 2

    =COUNTIF(C1:C6,”Level 1”)and(D1:D6,”6:30 Pm”)

    Expected results: 1

  2. #2
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    Try

    =SUMPRODUCT(--(C1:C6="Level 2")*(--(D1:D6=D2)))

    The D2 in the last conditoin extracts the value (not the formatted "string" you see). Putting 12:30Pm won't work because the value is actually 0.52083333...

    You might want to use a different reference cell (say, with a variable in).


    Alf

  3. #3
    Registered User
    Join Date
    01-08-2005
    Posts
    4

    Thumbs up It works

    Thank you very, very much it works.

  4. #4
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    You're welcome!

    Alf

+ 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