+ Reply to Thread
Results 1 to 5 of 5

countif with two arguments

  1. #1
    Registered User
    Join Date
    03-20-2008
    MS-Off Ver
    2003
    Posts
    17

    countif with two arguments

    Please Login or Register  to view this content.
    i want to add to this a second thing to check...so i want both to be true before adding to the count...the second part needs to be <>0, but i do not know how to tie the two together to work

    So if A1 is 3191 and B1 >0 then count 1 otherwise 0

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

    =Sumproduct((A1:A1000=3191)*(B1:B1000<>0))
    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
    03-20-2008
    MS-Off Ver
    2003
    Posts
    17
    when i put that in i just get a zero...
    that code looks like you are multiplying the two arguments together...

    what i am trying to do is look at both cells A1 and B1 if they both meet the criteria of being 3191 and <>0 then make a tally of it...end the end i want to know how many times in my spreadsheet employee 3191 has more then 0 hours worked.

    Am i mis understanding the code that was given to me

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Is the code 3191 a numeric code or is it a text string?

    maybe?

    =Sumproduct((A1:A1000="3191")*(B1:B1000<>0))

    Note: This formula multiplies the results of the conditions together and then sums those products... I.e. each condition yields arrays of TRUES and FALSES that when multiplied together converts the TRUES and FALSES to 1's and 0's.

  5. #5
    Registered User
    Join Date
    03-20-2008
    MS-Off Ver
    2003
    Posts
    17
    Thanks it is working now

+ 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