+ Reply to Thread
Results 1 to 13 of 13

Trying to create total numbers if certain criteria is met

  1. #1
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Trying to create total numbers if certain criteria is met

    Hey all,

    I'm trying to create a number count on the OUTPUT - Numbers with the numbers as seen in the attachment that calculates from the month listed in each column, which will change, of more than 4 months which an animal's shots are from the last shot date, i.e. on the NameTab1 if C column, then more than 4 months time period has lapsed, then count it on the OUTPUT - Numbers page. I've uploaded it an example if anyone can help. I don't want a pivot table but a formula.

    Thanks.

    Rick

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Trying to create total numbers if certain criteria is met

    Please Login or Register  to view this content.
    countif will do the job for you.

    But why not a pivot table, they made for this kind of work?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Trying to create total numbers if certain criteria is met

    Not sure where you got the values from in your table, nor which column you want to test teh dates against, but try this, copied down and across...
    =COUNTIFS(NameTab1!$B$2:$B$139,'OUTPUT - Numbers'!$A3&"*",NameTab1!$E$2:$E$139,">="&'OUTPUT - Numbers'!B$2,NameTab1!$E$2:$E$139,"<"&EDATE('OUTPUT - Numbers'!B$2,1))

    You may need to change teh date columns
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Trying to create total numbers if certain criteria is met

    Oeldere - I haven't used them and the column dates will change due to the need for a 12 month rolling calendar. Is a pivot table going to help with that as well?

    FDibbins - Thanks. Let me see if that works. The dates are tested against the current month and 4 months prior to ensure that shots are done after the 4 months timeframe. I probably won't use 4 months out since a year is sufficient time but I needed a shorter window to see if it works.

    If my question is resolved, I'll change to solved using the thread tools.

    Thanks again.
    Last edited by RickMadsen; 07-15-2014 at 08:36 AM.

  5. #5
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Trying to create total numbers if certain criteria is met

    Hey FDibbins,

    I don't see where the number count was done for all cases where 4-months timeframe had lapsed from the month in row 2 of the OUTPUT - Numbers. Hence, why I have 0 in the AET row but 1 in the VED row. There was only one case in VED that didn't get shots from the 4 month timeframe from the January month. Does this make sense or do you need more clarification?

    Please let me know since the countifs I have used before and would like to continue using.

    Thanks.

    Rick
    Last edited by RickMadsen; 07-15-2014 at 08:47 AM. Reason: change of question

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Trying to create total numbers if certain criteria is met

    This can be done with an pivot-table, but you have to tell us how the manual added desired result, is related to the date.

    I tried several options, but don't come to the same result.

  7. #7
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Trying to create total numbers if certain criteria is met

    Hey oeldere - Sorry, I screwed up the manual count for AET and VED animals on this but REF animal rows are correct. I want to base by month for each column the number of animals that needed shots greater than 4 months prior of the month. Therefore the REF animal in April should be 1 since REF-Cat's (No. 123528) last shot was December 19, 2013 but in March the 4 month time frame was acceptable but in April 2014, it wasn't. Make sense?

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Trying to create total numbers if certain criteria is met

    see the attached file with an pivot table.

    You have to tell us the criteria.

  9. #9
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Trying to create total numbers if certain criteria is met

    Thanks oeldre. This is getting close to it but I want to lump in AET into one line, and same for the REF and VED.

    I'm not sure what you mean by criteria which I have given several times. I want to know in January how many AET, REF, or VED animals haven't had their shots based on the "Last Shot Date (column E)" in more than 4 months time, then February as well, and such.

    As for the pivot table, I'm not sure it will work since AET-Cat, AET-Dog, and such are not lumped together into the AET or such.

    Is there a way to do a formula that takes the date filed minus 4 months prior and with the Name (first part before the dash)?

    Rick
    Last edited by RickMadsen; 07-15-2014 at 04:19 PM. Reason: Typo errors

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Trying to create total numbers if certain criteria is met

    This solves the problem wiht the names.

    =left(b2,3)

    See the attached file.

  11. #11
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Trying to create total numbers if certain criteria is met

    Thanks oeldere but reviewing the new pivot table isn't correct. If January had 4 cases for AET animals haven't had their shots in the last 4 months, then February should be January numbers plus February's. Maybe I need to repost to with COUNTIFS section of this.
    Last edited by RickMadsen; 07-16-2014 at 08:30 AM. Reason: grammatical error

  12. #12
    Registered User
    Join Date
    03-10-2014
    Location
    Naperville, IL
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Trying to create total numbers if certain criteria is met

    Actually I need to delete this thread. I've screwed up what I specifically need and need to rethink how to word it better for the criteria.

    Thanks for all of the help though.

  13. #13
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Trying to create total numbers if certain criteria is met

    Another try.

    Based on the data in column E (last shot).

    als cummalitive data.

    See the attached file.

+ 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] Separate total of negative numbers and positive numbers.
    By avidcat in forum Excel General
    Replies: 3
    Last Post: 04-06-2014, 07:26 PM
  2. Replies: 3
    Last Post: 03-06-2014, 12:48 AM
  3. Replies: 1
    Last Post: 09-03-2013, 07:41 PM
  4. Replies: 6
    Last Post: 05-22-2013, 05:28 PM
  5. Need one column total if criteria meets another columns criteria
    By jebrown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-24-2013, 08:47 PM

Tags for this Thread

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