+ Reply to Thread
Results 1 to 11 of 11

Countif on multiple conditions

  1. #1
    Registered User
    Join Date
    05-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    10

    Countif on multiple conditions

    I'm trying to do a count on multiple conditions . Tried countif and countifs but in vain.

    Here's what I'm trying to do. I have three columns "Tasks" , "Baseline" & "Closed" on worksheet 1. In worksheet 2, I have another 3 columns "week ending" , "# of baseline Tasks" and "# of closed tasks" . The last columns must be calculated based on the number of tasks that are ending on that particular week.

    Not sure if i managed to explain it clearly. I'm attaching the spreadsheet for reference. Any help is sincerely appreciated.
    Attached Files Attached Files
    Last edited by NBVC; 10-12-2011 at 04:08 PM.

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

    Re: Countif on multiple conditions

    Perhaps these?

    In C4:
    =COUNTIFS('Activity Tracker'!J:J,">="&B4-7,'Activity Tracker'!J:J,"<="&B4)

    and in D4:

    =COUNTIFS('Activity Tracker'!L:L,">="&B4-7,'Activity Tracker'!L:L,"<="&B4)

    both copied down.

    These count number of date entries that start at weekend date - 7 days to the week ending date...
    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
    Registered User
    Join Date
    05-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif on multiple conditions

    Mate..I just tried the formula but the doesn't seem to be right. I'm not sure if am doing it right.
    For example number of the count for num of tasks for week ending should read like this
    Week Ending # Of Baseline Tasks
    05-Aug-11 1
    12-Aug-11 1
    19-Aug-11 2
    -
    18-Nov-11 98 ( this adds up to the total number of tasks)

    May be I didn't explain it correctly. Thank a ton for your help. Sincerely appreciate it

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

    Re: Countif on multiple conditions

    So are you looking for a cumulative count?

    e.g. in C4:

    =COUNTIF('Activity Tracker'!J:J,"<="&B4)

    in D4

    =COUNTIF('Activity Tracker'!L:L,"<="&B4)

  5. #5
    Registered User
    Join Date
    05-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif on multiple conditions

    Sorry..Yes I was looking for cumulative count. Thanks a ton )))

  6. #6
    Registered User
    Join Date
    05-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif on multiple conditions

    the cumulative counts comes to 98 but for some strange reason the count on the first cell shows "0" where it should be showing 1. The count for week end 05 Aug 2011 shows 0. not sure what's happening there

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

    Re: Countif on multiple conditions

    It looks like you have cells with dates and times and cells with just dates... they should be consistent and prefer not to have the times.. but you may be able to use formula adjustments as:

    =COUNTIF('Activity Tracker'!J:J,"<"&B4+1)

    =COUNTIF('Activity Tracker'!L:L,"<"&B4+1)

  8. #8
    Registered User
    Join Date
    05-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif on multiple conditions

    Yes..you were right. Now it works like magic. BTW..how do i change all the cells to show just date and date & time? I tried to changing the cell format but it's not changing

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

    Re: Countif on multiple conditions

    Select the column(s) and do a CTRL+H. In the Find What field enter a space followed by an asterisk... " *" (without the quotes)

    leave the Replace with blank.

    Hit Replace All

  10. #10
    Registered User
    Join Date
    05-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif on multiple conditions

    thanks a ton mate. u r amazing *bows* )

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

    Re: Countif on multiple conditions

    You are welcome.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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