+ Reply to Thread
Results 1 to 7 of 7

Countif or Sumproduct?

  1. #1
    Registered User
    Join Date
    02-12-2008
    Posts
    45

    Countif or Sumproduct?

    Good afternoon all, I am having a bit of difficulty with a formula and hoping someone here can help me.

    I have a spreadsheet where I want to count how many cases there are for each month so I have the following formula

    =COUNTIF('DS DO Transfers'!A:A,"<"&I20)-COUNTIF('DS DO Transfers'!A:A,"<="&I19)

    In column I20 and I19 I have the date range and this works fine.

    I now want to count how many of these cases are completed within the same range.

    So I can do this for the whole spreadsheet but I don’t know how to add in the date command.

    So the formula to find the whole sheet is simply:

    =COUNTIF('DS DO Transfers'!P:P,"Case Complete")

    I believe I cant use countif if there is more than one criteria so would I need to use something like =Sumproduct?

    Any help would be really appreciated as I am getting near giving up!

    Cheers
    Last edited by Scotsman89; 07-08-2011 at 05:47 AM.

  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 or Sumproduct?

    If you have XL2007 or later you can use COUNTIFS for multiple criteria, else yes Sumproduct.. but not with whole column references.

    e.g

    =SUMPRODUCT(--(P'DS DO Transfers'!$P$1:$P$100="Case Complete"),--('DS DO Transfers'!$A$1:$A$100<I2),--('DS DO Transfers'!$A$1:$A$100>I19))
    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
    02-12-2008
    Posts
    45

    Re: Countif or Sumproduct?

    Quote Originally Posted by NBVC View Post
    If you have XL2007 or later you can use COUNTIFS for multiple criteria, else yes Sumproduct.. but not with whole column references.

    e.g

    =SUMPRODUCT(--(P'DS DO Transfers'!$P$1:$P$100="Case Complete"),--('DS DO Transfers'!$A$1:$A$100<I2),--('DS DO Transfers'!$A$1:$A$100>I19))
    That is fantastic, it worked with

    =SUMPRODUCT(--('DS DO Transfers'!$P$1:$P$100="Case Complete"),--('DS DO Transfers'!$A$1:$A$100<I20),--('DS DO Transfers'!$A$1:$A$100>I19))

    Thanks a lot for your help.

    A final question if its ok, if i wanted to find the value of the cases were complete for the exact same range but in column Q I thought it would be the formula below but it does not work. Any ideas?

    =SUMPRODUCT(--('DS DO Transfers'!$P$1:$P$100="Case Complete"),--('DS DO Transfers'!$A$1:$A$100<I20),--('DS DO Transfers'!$A$1:$A$100>I19)),'DS DO Transfers'!$Q1$:$Q100)

  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 or Sumproduct?

    Seems like it should work if the first one did... are you sure the values in Q are formatted as General or Number....

    Try selecting column Q and go to data|text to columns and just click Finish.

    Then format the column as General (or Number).

    Does that work?

  5. #5
    Registered User
    Join Date
    02-12-2008
    Posts
    45

    Re: Countif or Sumproduct?

    Quote Originally Posted by NBVC View Post
    Seems like it should work if the first one did... are you sure the values in Q are formatted as General or Number....

    Try selecting column Q and go to data|text to columns and just click Finish.

    Then format the column as General (or Number).

    Does that work?
    It says "the formula you typed contained an error" so i must have something a little wrong but cant see what it is! Any help would be greatly appreciated!

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

    Re: Countif or Sumproduct?

    Try:

    =SUMPRODUCT(--('DS DO Transfers'!$P$1:$P$100="Case Complete"),--('DS DO Transfers'!$A$1:$A$100<I20),--('DS DO Transfers'!$A$1:$A$100>I19),'DS DO Transfers'!$Q$1:$Q$100)

  7. #7
    Registered User
    Join Date
    02-12-2008
    Posts
    45

    Re: Countif or Sumproduct?

    Quote Originally Posted by NBVC View Post
    Try:

    =SUMPRODUCT(--('DS DO Transfers'!$P$1:$P$100="Case Complete"),--('DS DO Transfers'!$A$1:$A$100<I20),--('DS DO Transfers'!$A$1:$A$100>I19),'DS DO Transfers'!$Q$1:$Q$100)
    Brilliant it works perfectly! Thanks again for your help!

+ 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