+ Reply to Thread
Results 1 to 21 of 21

Trying to measure compliance on expiry dates for training

  1. #1
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Trying to measure compliance on expiry dates for training

    Hi all,
    I have a file I want to add some formulas to, that I "think" may be countif. The first formula is to return a compliance level in D5 by adding all the cells within a range with a date greater than today or NA - but anything less than today, or a blank cell it ignores.
    The formulas are (I think) in
    Please Login or Register  to view this content.
    but can't quite finish it.
    On the Compliance worksheet, this is where I really got lost!
    I have a chart I want to populate based on the dates in the cells in the Current worksheet, but using a criteria of the conditional formatting within the date range of cells (3 rules), and return three values. 1 of anything within 30 days, 1 of anything within 90 days, and 1 of anything within 365 days.

    Any help would be appreciated please.
    Attached Files Attached Files
    Last edited by Johnny247; 05-01-2019 at 04:58 PM. Reason: Forum rules

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Countif challenge???

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Countif challenge???

    Thanks for your help! Here is the attached file. Hopefully it will all make sense..
    Attached Files Attached Files

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Countif challenge???

    May be:
    =COUNTIF(G8:AW15,"<"&TODAY()+30)
    ???
    Quang PT

  5. #5
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Countif challenge???

    Hi, thanks for your reply. No, I'm afraid that does not work.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,715

    Re: Countif challenge???

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: Countif challenge???

    Are you positive that some of them dates are due in 3 months? I did a quick array formula & they're all showing up as false.

    This was after converting the data to general and removing the text values in the data set with the array formula:

    Please Login or Register  to view this content.
    If it's been helpful please mark as helpful

  8. #8
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Countif challenge???

    Hi. Amended as requested. Apologies and hope that complies now.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,715

    Re: Need help with some formulas please

    No, sorry. Your title needs to mention what you are trying to achieve. Try summarising the second and third lines of your opening post - that will tell us something about what you want to do. At the moment, it tells us nothing. Think Google search!

  10. #10
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Need help with some formulas please

    Hi. I have amended the title again. Please advise if that is better as I am not sure what else to write in it now.
    Thanks.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,715

    Re: Trying to measure compliance on expiry dates for training

    Much better - thank you.

  12. #12
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Countif challenge???

    Hi, thanks for your reply. It is some test data that I used to populate and make the conditional formatting work. The actual data will have a much bigger range of dates populating some of the empty cells as well. Please feel free to change any dates, or frequencies from the drop downs to get to 3 months.
    Kind Regards

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: Trying to measure compliance on expiry dates for training

    Considering the statement: "The first formula is to return a compliance level in D5 by adding all the cells within a range with a date greater than today or NA" try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If that doesn't work it may help if you could tell us, based on the file attached to post #3, what value should be in cell D5 and also explain why.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  14. #14
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Trying to measure compliance on expiry dates for training

    Hi, thanks for your reply.
    No, I'm afraid that it does not work. I'll explain what the sum in D5 is for so hopefully that will help:
    The value should return a sum of 50%.
    The reason for that is:
    there are 328 cells in the range G* to AW15 that are part of the criteria (ignoring the cells in N and P 8 to 15)
    71 of these have a returned format of Green dates (based on the conditional formatting)
    2 have a Red date Based on the conditional formatting. As these are overdue then they should be treated the same as a blank cell (as they are non compliant).
    93 have NA in.
    Adding the compliant cells (71 Green and NA) gives me a total of 164.
    The sum in D5 should give me a percentage based on total amount of compliant cells, so in this case, should read 50% (164/328).
    Therefore, the formula you supplied (thank you), when put in BG5 should give me a total of 164. The D5 is simply BG5/328 formatted as a percentage.
    Hopefully that all makes sense!
    I think the bit that is difficult is that the number will change based on the conditional formatting.

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: Trying to measure compliance on expiry dates for training

    This proposal adds a row below the table which may be moved and/or hidden for aesthetic purposes. Row 74 is populated using: =SUMPRODUCT((ISNUMBER(G8:G15))*(SUM(G8:G15,VLOOKUP(G5,dayslookup,2,0))>$A75))
    Note that the formula isn't placed in columns O and Q as O5 and Q5 don't have values. The "3 years" are actually in N5 and P5 which are merged. My suggestion would be to unmerge the cells, place the "3 years" in cells O5 and Q5, then copy the formula from N74 across to Q74.
    It appears that the merged cells are also causing a problem with cell O10 which incorrectly highlights green and Q10, Q15 which are not highlighted.
    Note that A75 is populated using: =TODAY() so that each formula in G74:AW74 doesn't have to lookup today's date.
    Cell BG5 is then populated using: =SUM(G74:AW74,COUNTIF(G8:AW15,"NA"))
    Note that the denominator for cell D5 is changed to 328 as stated in post #14.
    Let us know if you have any questions.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Trying to measure compliance on expiry dates for training

    That looks like a fantastic fix. Thank you very much for your help. Much appreciated!

  17. #17
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Trying to measure compliance on expiry dates for training

    Hi,
    I have just tried copying this across as the instructions above, and for some reason, it does not work outside of the sheet used? I have attached the file.
    Would you possibly be able to tell me where I have gone wrong on this?
    Kind Regards.
    Attached Files Attached Files

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,715

    Re: Trying to measure compliance on expiry dates for training

    The thread is currently marked as solved ... You might wish to change it.

  19. #19
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: Trying to measure compliance on expiry dates for training

    My apologies, the formula for the row below the table was not correct in my last post.
    The following array entered formula* yields values that match the number of dates highlighted in green for each column:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    The following formula is used in cell T3: =SUM(G84:M84,COUNTIF(G8:M58,"NA"))
    The following formula is used in cell D5: =T3/357
    Let us know if you have any questions.
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    12-18-2013
    Location
    Kings Lynn, England
    MS-Off Ver
    Excel 2019
    Posts
    234

    Re: Trying to measure compliance on expiry dates for training

    That's it. It all works now. Great help. Many thanks.

  21. #21
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: Trying to measure compliance on expiry dates for training

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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] if/then challenge
    By matt5596 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2014, 01:04 PM
  2. Here's a challenge:
    By RussellNonBrand in forum Excel General
    Replies: 2
    Last Post: 07-26-2011, 11:33 AM
  3. Who's up for a challenge...?
    By benzil in forum Excel General
    Replies: 1
    Last Post: 10-15-2010, 02:47 PM
  4. Who wants a challenge?
    By Aussie_Striker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2006, 09:05 AM
  5. Who wants a challenge?
    By Aussie_Striker in forum Excel General
    Replies: 2
    Last Post: 10-11-2006, 07:53 AM
  6. [SOLVED] countif challenge
    By Alan D in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-02-2005, 09:05 AM
  7. A Challenge
    By Jazzer in forum Excel Formulas & Functions
    Replies: 36
    Last Post: 09-06-2005, 12:05 PM
  8. [SOLVED] A COUNTIF function Challenge
    By Mr. G. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-19-2005, 04:06 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