+ Reply to Thread
Results 1 to 16 of 16

Countifs have logged in for 6 month

  1. #1
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Countifs have logged in for 6 month

    Hi All,

    I am trying to count how many people havent logged into a system for 6 months. The date format is "10/01/2014 10:02:37" just cant figure out how to extra a count on date.

    Hope you someone can help - see attached.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Countifs have logged in for 6 month

    All your dates are text and not numbers at all.

    in B2
    =IF(ISERROR(SEARCH("Logged",A2)),A2+0,0)
    and copy down

    in B1
    =COUNTIF(B2:B585,"<"&TODAY()-180)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Countifs have logged in for 6 month

    Your 'dates' are stored as text.

    So first, let's get them as actual date values: in B2 enter:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down to B3:B585.

    Now in Cell B1, we can do the COUNTIF:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    Thanks Special-K

    Problem is I will need to do this on a different sheet for various number of dates. Do you think its possible to do this in one cell?

  5. #5
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    As I mentioned to special k I would quite like to do this in one formula as I plan to add other counts if aka if F:F,"Yes"

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Countifs have logged in for 6 month

    You can either add helper cells (as we have already suggested), fix your source data, so it is stored as numerical date values, rather than text, or use a bit of VBA.

    Can you change the source data? Would you like a VBA solution?

  7. #7
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    Cant change the source data as that's how IT provide it. So it wouldn't be possible to so something with TEXT like TEXT(DATE(YEAR(TODAY())-6,MONTH(TODAY())-1,DAY(TODAY())),"mm-YYY") ? If not I would love some VBA

  8. #8
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    Both your formulas appear wrong. The answer should be 115 haven't logged in for over 6 months since 30 June 2014.

  9. #9
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Countifs have logged in for 6 month

    You are ignoring the "Never Logged In", then?

    Edit: and 30th June is 7 months ago...
    Last edited by Olly; 01-30-2015 at 11:56 AM.

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Countifs have logged in for 6 month

    =SUMPRODUCT(ISERROR(1/--(A2:A585+180>TODAY()))*1)
    try this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  11. #11
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    Oh yeah good point they need to count.

    How would I go about counting those haven't logged in during the last 6 months but have "Yes" to approved and "Yes" to active? see attached.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    Hero. Any idea how I can do that if A and B both = Yes. See the attached
    Attached Files Attached Files

  13. #13
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Countifs have logged in for 6 month

    Here's a UDF which does what you want:

    Please Login or Register  to view this content.
    Use as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Argument 1 = Lookin = the range of cells containing dates as text.
    Argument 2 = Criteria = a criteria string: "<", "<=", "=", ">=" or ">"
    Argument 3 = CompareDate = the date to compare against (in this example, 6 months before today)
    Argument 4 = CountErrors = if FALSE (or ommitted) error values (such as "Never Logged In") are not counted. If TRUE, they are counted.


  14. #14
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    Just realised there's a problem with this as the number of dates change when I dump data into the sheet

  15. #15
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Countifs have logged in for 6 month

    =SUMPRODUCT((A2:A585="Yes")*(B2:B585="Yes")*ISERROR(1/--(C2:C585+180>TODAY())))
    try this

  16. #16
    Forum Contributor
    Join Date
    08-19-2014
    Location
    Sussex, England
    MS-Off Ver
    2010
    Posts
    141

    Re: Countifs have logged in for 6 month

    I'm too much of a noob I couldnt get this work. I guess I need a formula that will do this for a whole column.

+ 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. COUNTIFS to recognize MONTH in a cell
    By mmsteiner in forum Excel General
    Replies: 6
    Last Post: 12-04-2014, 04:13 PM
  2. Countifs by date in month?
    By whizbee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-21-2013, 01:03 PM
  3. COUNTIFS filtered by month
    By HeathWilD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2012, 05:06 PM
  4. Month Validatioin in countifs formula
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2012, 01:02 PM
  5. Month Criteria in Countifs ????
    By mubashir aziz in forum Excel General
    Replies: 4
    Last Post: 02-26-2010, 05:38 AM

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