+ Reply to Thread
Results 1 to 8 of 8

Countifs with condition and interval range

  1. #1
    Registered User
    Join Date
    04-22-2020
    Location
    Viterbo, Italy
    MS-Off Ver
    2016
    Posts
    4

    Countifs with condition and interval range

    Hello
    I have a problem with function Countifs (maybe)

    Column A: Employed Names
    Column B: Hours
    Column C: "Criteria"


    "A" "B" "C"
    BOB 10:00 AM DOUBLE
    MARY 11:00 AM DOUBLE
    GEORGE 12:00 PM
    BOB 1:00 PM DOUBLE
    MARY 11:15 AM DOUBLE

    at present the function for C1 is:
    =IF(COUNTIF(A:A,A:A)>1,"DOUBLE ","")

    i would like it to be calculated the condition only if the value of cell B1 is less than one hour (or 60')

    Thank you in advance
    Attached Files Attached Files
    Last edited by marea69; 05-04-2020 at 05:14 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Countifs with condition and interval range

    countifs(A:A,A2,B:B, ??

    Are looking for the time difference between duplicates ?
    Mary = 11:00 AM & 11:15AM so thats less than 60 minutes
    BUT BOB is over 1 hr
    Are they only duplicated , or can the names appear multiple times
    IF so are they ordered in Time Order at all ?
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    04-22-2020
    Location
    Viterbo, Italy
    MS-Off Ver
    2016
    Posts
    4

    Re: Countifs with condition and interval range

    Names can appear up to 2 times a day
    but they cannot appear 2 times in less than an hour

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Countifs with condition and interval range

    Names can appear up to 2 times a day
    but they cannot appear 2 times in less than an hour
    Is that what you are trying to fix, or is that the data set
    If its the data set, then it will not be less than an hour

    I was asking about the data set you have

  5. #5
    Registered User
    Join Date
    04-22-2020
    Location
    Viterbo, Italy
    MS-Off Ver
    2016
    Posts
    4

    Re: Countifs with condition and interval range

    exactly like the file I attached.
    The only input takes place in column A via barcode scanner
    The rest happens automatically.

    I am creating an access control manager for the company canteen.
    Therefore I would like Bob (for example) to be able to eat for lunch and dinner (2 times), but he cannot eat 2 times in less than an hour (double stamping)

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Countifs with condition and interval range

    This only shows the first double entry - not the last one , but will work for multiple entries
    =IFERROR(IF(AND(COUNTIF(A2:$A$100,A2)>1,(INDEX(B3:$B$100,MATCH(A2,A3:$A$100,0))-B2)<=TIMEVALUE("01:00"),(INDEX(B3:$B$100,MATCH(A2,A3:$A$100,0)))>TIMEVALUE("00:00")),"Double <1hr",""),"")

    I'm sure there is a better way

    But this was done before you submitted a sample sheet
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-22-2020
    Location
    Viterbo, Italy
    MS-Off Ver
    2016
    Posts
    4

    Re: Countifs with condition and interval range

    The second solution you sent me is fine.
    I think I solved it this way.

    Thank you very much

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Countifs with condition and interval range

    you are welcome,
    I'm sure there is a way to highlight both entries with a simple formula

+ 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] COUNTIFS with OR condition
    By technik in forum Excel General
    Replies: 7
    Last Post: 09-25-2019, 12:57 PM
  2. [SOLVED] Multiple Condition Countifs with Uniqueness as Condition
    By semantics in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-21-2017, 05:21 PM
  3. Expressing a time range as a condition of a COUNTIFS function
    By MK104 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-29-2016, 02:54 PM
  4. COUNTIFS using date as condition
    By aijp in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-21-2013, 04:27 PM
  5. [SOLVED] Countifs with a date as a condition
    By nickmessick1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-06-2013, 07:58 AM
  6. Replies: 3
    Last Post: 12-16-2011, 10:55 AM
  7. COUNTIFS with a variable condition
    By cjsec9 in forum Excel General
    Replies: 2
    Last Post: 04-01-2009, 02:51 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