+ Reply to Thread
Results 1 to 8 of 8

Evaluating a specified array for 2 (or more) criteria and returning a value

Hybrid View

  1. #1
    Registered User
    Join Date
    03-08-2021
    Location
    Denver, CO
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Evaluating a specified array for 2 (or more) criteria and returning a value

    So, I feel like this is a bit different from your typical INDEX/MATCH array function, but maybe not.

    Essentially, the data shows 4 Procedure Categories:
    - Office Visit
    - Covid Test
    - Covid Vaccine
    - Not Specified

    A patient can have Office Visit with no Covid Test, or an Office Visit with Covid Vaccines. The "Not Specified" category is negligible, but I'd still like to show it.

    The request is to show patients with a combination of "Office Visit" and "Covid Test" by having the 2 occur in the same visit. Here is my sample data attached.

    Ideally, I'd like to separate Office Visits Only, Covid Vaccines Only, and Office Visits with a Covid Test. Any help is appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365
    Posts
    3,184

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    How about a PIVOTTABLE?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-08-2021
    Location
    Denver, CO
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    Quote Originally Posted by belinda200 View Post
    How about a PIVOTTABLE?
    That's essentially what I'm trying to create. I believe the client wants to see something more along the lines of "On 4/2, Patient A came to Clinic B and made an Office Visit. There was no Covid Test performed, so this was a routine Office Visit", "On 4/3, Patient B came to Clinic C and made an Office Visit with a Covid Test performed. This should be designated a 'Covid Test Visit'."

    Sorry I wasn't more specific in my original post. This data will end up being a pivot table once the correct "Procedure Category" fields are populated as I described.

    Thank you!

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    Pl see file.
    3 tables are given for Office Visits Only, Covid Vaccines Only, and Office Visits with a Covid Test.
    Each table has one formula
    Formula 1 in L2
    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(Table1,,1))/(COUNTIF($J$1:$K$1,INDEX(Table1,,6))>0),ROWS(L$2:L2))),"")
    Formula 2 in T2
    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(Table1,,1))/(COUNTIF($S$1,INDEX(Table1,,6))>0),ROWS(T$2:T2))),"")
    Formula 3 in AB2
    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(Table1,,1))/(COUNTIF($AA$1,INDEX(Table1,,6))>0),ROWS(AB$2:AB2))),"")
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    03-08-2021
    Location
    Denver, CO
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see file.
    3 tables are given for Office Visits Only, Covid Vaccines Only, and Office Visits with a Covid Test.
    Each table has one formula
    Formula 1 in L2
    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(Table1,,1))/(COUNTIF($J$1:$K$1,INDEX(Table1,,6))>0),ROWS(L$2:L2))),"")
    Formula 2 in T2
    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(Table1,,1))/(COUNTIF($S$1,INDEX(Table1,,6))>0),ROWS(T$2:T2))),"")
    Formula 3 in AB2
    =IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(Table1,,1))/(COUNTIF($AA$1,INDEX(Table1,,6))>0),ROWS(AB$2:AB2))),"")
    This is super close to what I need. Sorry for not being more specific in my original post.

    From my original table, I would need a new column that looks at the table itself and evaluates for an array of "Same Patient Visits", and making the determinations, "Office Visit Only", "Covid Test Visit", and "Covid Vaccine".

    I'm going to try to reframe the formulas you provided to fit that need, but would appreciate a solution in the meantime, if you arrive at one!

    Thank you for the help!

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    Pl type expected results in the file and upload file.

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

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    Seem like to mark "X" if one ID has "Office Visit" and "Covid Test" in a same day?

    G2:

    =IF([@[Procedure Category ID]]="Covid Test",IF(COUNTIFS([Svc_Date],[@[Svc_Date]],[Patient ID],[@[Patient ID]],[Procedure Category ID],"Office Visit"),"X",""),"")
    Attached Files Attached Files
    Quang PT

  8. #8
    Registered User
    Join Date
    03-08-2021
    Location
    Denver, CO
    MS-Off Ver
    MS Office 2016
    Posts
    9

    Re: Evaluating a specified array for 2 (or more) criteria and returning a value

    This is actually what I was looking for! Can't believe I didn't think of that. Thank you!

+ 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. Array Formulas with Multiple Range Criteria - not returning result
    By btparkhe1920 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2020, 04:41 PM
  2. [SOLVED] Filter Array 1 with Array 2 as criteria, returning filtered data to source sheet
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2019, 01:08 PM
  3. Replies: 2
    Last Post: 12-17-2014, 01:00 AM
  4. [SOLVED] Array lookup returning value equal or next greater depending on criteria (column)
    By FPS in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-03-2012, 11:23 AM
  5. [SOLVED] Need help evaluating a cell and returning a different result depending on the findings
    By Cardamone in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-27-2012, 03:54 PM
  6. Multi Criteria combo box returning array values
    By robcosta in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-24-2008, 10:41 AM
  7. Returning Data from an array only if it meets certain criteria
    By Jantzev in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-02-2008, 07:57 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