+ Reply to Thread
Results 1 to 5 of 5

Check if UID meets 2 criteria

  1. #1
    Registered User
    Join Date
    05-09-2018
    Location
    Northern Ireland
    MS-Off Ver
    2016
    Posts
    3

    Unhappy Check if UID meets 2 criteria

    Hi,

    This one has me stumped!

    I have a list of appointments for people (all of which have a unique ID). There are 2 services that they could have had an appointment with. Service A and B. I got as far as indicating if they have seen each service (e.g. Seen service A (yes, no), seen service B (yes, no). This is the bit I can’t work out. I have need to find the people who have seen service A and also service B. So check UID 001 - service A yes and yes for the same UID in service B.

    At first I thought it would be very straightforward, if service A yes and service B yes...but each person could have several appointments so if I filter out the no’s from service A it rips out the yes’s in service B.

    UID. Date. Service A. Service B
    001. 1/1. Yes. No
    001. 2/1. No. Yes
    001. 3/1. No. Yes
    002. 2/3. No. Yes
    002. 3/3. No. Yes

    From example above, only 001 has seen both services as 002 has only seen service B. Hope this explains it.

    I Cheers

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Check if UID meets 2 criteria

    You explained what you're trying to figure out but not what you want your result to look like. Do you want another column for each row that says whether they have had both A&B, or do you want it in a completely different place, just listed by UIDs?

    Suppose your data is in columns A, B, C, D. You have a list of UIDs somewhere in column M. In N:

    =IF(AND(COUNTIFS(A:A,M1,C:C,"Yes")>0,COUNTIFS(A:A,M1,D:D,"Yes")>0),"BOTH","")

    Or if you want to put in next to your existing data in column E

    =IF(AND(COUNTIFS(A:A,A1,C:C,"Yes")>0,COUNTIFS(A:A,A1,D:D,"Yes")>0),"BOTH","")

    Copy down.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-09-2018
    Location
    Northern Ireland
    MS-Off Ver
    2016
    Posts
    3

    Thumbs up Re: Check if UID meets 2 criteria

    That worked a treat and very logical.

    Yes, I needed them in a column beside, so I took option B.

    Only adjustment I had to make was to make it cell A2 instead of A1 because of my headers and add in a false statement.

    I really appreciate the response. Thank you6StringJazzer

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Check if UID meets 2 criteria

    You are very welcome.

  5. #5
    Registered User
    Join Date
    05-09-2018
    Location
    Northern Ireland
    MS-Off Ver
    2016
    Posts
    3

    Re: Check if UID meets 2 criteria

    I had a few more practice goes there so the logic and method sticks. I was then able to knock out a simple pivot of the list of ID's who visited both.

    Another occasion of me shouting at my screen "Of course! That makes sense now. Why didn't I think like that?"

+ 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. MAX if meets 2 criteria.
    By Mnaylor in forum Excel General
    Replies: 2
    Last Post: 07-15-2014, 03:39 PM
  2. Replies: 4
    Last Post: 02-17-2014, 04:05 AM
  3. To check in a column a certain criteria meets and display dialog box
    By bmbalamurali in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-12-2013, 04:31 AM
  4. 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
  5. Replies: 1
    Last Post: 02-16-2012, 09:57 AM
  6. Help with SUM only IF meets both criteria
    By mahri811 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-25-2010, 11:53 AM
  7. Max value that meets a criteria
    By David Burr in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-16-2005, 09:31 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