+ Reply to Thread
Results 1 to 5 of 5

Count if statement with selective Counting

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Count if statement with selective Counting

    Good morning, I'm hoping someone can help me with a snag I've run into on a form I'm redesigning.

    The User will be weighing product and entering weights into cells E30:E59. Specifications state that product must fall between a minimum and maximum weight, E13 and H13 respectively. E23 and E24 track the number of weighed products that fall over spec weight and under spec weight respectively. The challenge is that the measured weight is a gross weight. the formula must subtract a tare weight located in E21 in the form of a percent from the measured or gross weight before it tallies the weight as over or under spec.

    Example:

    E13 - Min=50
    H13 - Max=100

    E21 - Tare=10%

    User weighs 5 products:

    E30 = 108
    E31 = 52
    E32 = 125
    E33 = 75
    E34 = 160

    E23 = 2 (125, 160 - Even though 108 is greater than 100, after the 10% tare weight is factored in, the net weight is no longer over spec)

    E24 = 1 (even though the gross weight 52 is over the 50 minimum, after the 10% tare weight is factored in, the net weight falls under spec)

    Up until I had to calculate the tare, the formula I was using looked like this:

    Please Login or Register  to view this content.
    I've played with it a little bit and tried to modify it to account for the tare weight.... but thus far have been unsucessful.

    Thanks for your help

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

    Re: Count if statement with selective Counting

    Would that be?

    =IF(E30="","",COUNTIF(E30:E59,">"&$H$13*(1+$E$21)))

    and

    =IF(E30="","",COUNTIF(E30:E59,"<"&$E$13*(1+$E$21)))
    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
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: Count if statement with selective Counting

    why not calculate the Tare weight : I13 =if(and(H13<>"",E21<>""),H13*(1-E21),"")

    Then you can point E23 @ I13 etc...

  4. #4
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Count if statement with selective Counting

    Yes, that worked perfectly NBVC, thank you!

  5. #5
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Count if statement with selective Counting

    I see what you're saying Crimedog, I think that would have worked as well

    Thank you!

+ 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