+ Reply to Thread
Results 1 to 15 of 15

countifs gives me #VALUE! trying to count if two criterea are met.

  1. #1
    Registered User
    Join Date
    11-07-2017
    Location
    detroit, mi
    MS-Off Ver
    360
    Posts
    6

    countifs gives me #VALUE! trying to count if two criterea are met.

    I am trying to get a count of employees in certain areas on a schedule recap. I am working on a modified template of a project planner from excel.
    column A has drop down lists of all possible areas
    columns B through H have title, description of work, and drop down lists of employees names along with other linked cells to generate graphs

    most sense to me is as followed:

    =COUNTIFS(A6:A57,Employees!E2,project!B6:H57,Employees!B5)

    A6:A57 is the range in which "the area" is located

    Employees!E2 refers to another sheet with "the area"

    B6:H57 is the range in which an employees name will be located

    Employees!B5 refers to another sheet with an employees name

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    The ranges in countifs must be of similar dimensions.
    You first have A6:A5 - a 1 column range
    Then you have B6:H57 - a 7 column range.

    Try
    =SUMPRODUCT((A6:A57=Employees!E2)*(B6:H57=Employees!B5))

  3. #3
    Registered User
    Join Date
    11-07-2017
    Location
    detroit, mi
    MS-Off Ver
    360
    Posts
    6

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    still having the same error. after looking up the SUMPRODUCT it stated that the array arguments must have the same dimensions. If they do not, SUMPRODUCT returns the #VALUE! error value.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    The formula I posted has only 1 argument in the sumproduct.
    The 2 calculations are done first with simple True's and False's, and returned as a single array to sumproduct.

    If that formula also returned #Value! error, that is likely due to pre-existing #Value! Errors within the ranges A6:H57

  5. #5
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    Quote Originally Posted by atlasguy View Post
    =COUNTIFS(A6:A57,Employees!E2,project!B6:H57,Employees!B5)
    I am not entirely sure but I want to say that COUNTIFS criteria ranges all need to be on the same sheet. In your formula they are not.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    Quote Originally Posted by Zer0Cool View Post
    I am not entirely sure but I want to say that COUNTIFS criteria ranges all need to be on the same sheet. In your formula they are not.
    No they don't 'have' to be on the same sheet.
    It doesn't make much logical sense for them not to be, but it won't cause the #Value! Error.

    I've gone on the assumption that the formula is actually entered on the project sheet.
    So range A6:A57 would still refer to that sheet.
    And the sheet reference on project!B6:H57 is actually superfluous.
    I just removed it from my suggested formula.

  7. #7
    Registered User
    Join Date
    11-07-2017
    Location
    detroit, mi
    MS-Off Ver
    360
    Posts
    6

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    I changed how the data was arranged and it fixed my issue thank you very much for helping

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    You're welcome.

    Would you mind elaborating a little bit on how exactly you changed it?
    For the benefit of future readers who search the forum with similar problem.

  9. #9
    Registered User
    Join Date
    11-07-2017
    Location
    detroit, mi
    MS-Off Ver
    360
    Posts
    6

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    yes,

    like you had mentioned since I was searching multiple columns for data it made it have the #value! error.
    I rearranged the data on my sheet to be in single columns and turned the text 90 degrees so I could read the info. after that I used the countifs formula to search for my criteria separate in each column

    I had to make it rather long but it works

    unless someone else has a better solution

    this is what I used

    =COUNTIFS(A6:A53,"Body Shop",B6:B53,"Gawlowski, Tom")+COUNTIFS(A6:A53,"Body Shop",C6:C53,"Gawlowski, Tom")+COUNTIFS(A6:A53,"Body Shop",D6:D53,"Gawlowski, Tom")+COUNTIFS(A6:A53,"Body Shop",E6:E53,"Gawlowski, Tom")+COUNTIFS(A6:A53,"Body Shop",B6:B53,"Hudson, Don")+COUNTIFS(A6:A53,"Body Shop",C6:C53,"Hudson, Don")+COUNTIFS(A6:A53,"Body Shop",D6:D53,"Hudson, Don")+COUNTIFS(A6:A53,"Body Shop",E6:E53,"Hudson, Don")

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    Amending Jonmo's suggestion, you can use SUMPRODUCT like this

    =SUMPRODUCT((A6:A53="Body Shop")*ISNUMBER(MATCH(B6:E53,{"Gawlowski, Tom,"Hudson, Don"},0)))
    Audere est facere

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    You really should use the sumproduct...

    =SUMPRODUCT((A6:A53="Body Shop")*(B6:E53="Gawlowski, Tom"))

  12. #12
    Registered User
    Join Date
    11-07-2017
    Location
    detroit, mi
    MS-Off Ver
    360
    Posts
    6

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    thank you very much I used daddylonglegs formula and it worked perfectly after I fixed the quotes around the text. you guys are awesome! I'm going to have to learn a little bit more about how sumproduct works but I'm extremely happy now

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    Quote Originally Posted by atlasguy View Post
    ......after I fixed the quotes around the text.......
    Yeah, I thought I'd make it just that little bit more challenging

  14. #14
    Registered User
    Join Date
    11-07-2017
    Location
    detroit, mi
    MS-Off Ver
    360
    Posts
    6

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    so one more quick question.
    can I adapt this formula to use data off a separate sheet?
    since I use drop down menus for data on the main sheet it would be easier to modify the list if my employees change instead of hard punching names in the formula?

    right now it wont let me.

  15. #15
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: countifs gives me #VALUE! trying to count if two criterea are met.

    If you want to use cell references from another sheet in the formula that I suggested then that only works if it's a range, e.g.

    =SUMPRODUCT((A6:A53="Body Shop")*ISNUMBER(MATCH(B6:E53,Employees!B4:B5,0)))

    If you need the names to be from Employees!B4 & Employees!B7, for example then you can use Jonmo's version to do each and sum them

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Do not SUMIF with two criterea not to count (not equal to)
    By Galin12 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-16-2017, 02:09 PM
  2. lookup mutiple criterea to get a particular value
    By mws in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-24-2014, 07:05 AM
  3. calculate average based on one criterea
    By adil.costing in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-26-2012, 02:45 PM
  4. Random list generation with criterea
    By Steffen_DK in forum Excel General
    Replies: 4
    Last Post: 02-05-2012, 07:37 PM
  5. Maximum sum based with criterea
    By Yonni in forum Excel General
    Replies: 4
    Last Post: 09-26-2010, 07:34 PM
  6. Multiple criterea in a countif
    By TmRCA in forum Excel General
    Replies: 5
    Last Post: 07-21-2009, 11:18 AM
  7. count /sum/sum product from multiple criterea
    By martindwilson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2008, 07:01 PM

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