+ Reply to Thread
Results 1 to 4 of 4

Query to Return Results Based on Specific Criteria

  1. #1
    Registered User
    Join Date
    08-06-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    7

    Query to Return Results Based on Specific Criteria

    Hi,

    I work with a chemotherapy prescribing system and would like to identify regimes that are Oral only (none intravenous). Some regimes include both, or are IV only.

    I have a sheet with 2 columns, A gives prescription name and B gives route i.e. Oral/IV. An example:

    Rx 1 Oral
    Rx 1 IV
    Rx 2 Oral
    Rx 3 IV
    Rx 4 Oral
    Rx 4 IV

    I need a query that would only return Rx 2 - in my example, Rx 2 is the only one to have Oral and no other routes associated.

    Is this possible in Excel?

    Many thanks
    Last edited by AliGW; 01-03-2019 at 09:35 AM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2010 primarily
    Posts
    2,290

    Re: Unsure how to ask this

    You could add a new column with a formula like:

    =COUNTIFS(A:A,A2,B:B,"IV")=0

    (I've assumed row 2 is the first data row)

    and then filter the new column for TRUE values.
    Rory
    If a job's worth doing, it's worth doing right
    over your shoulder by your boss

  3. #3
    Registered User
    Join Date
    08-06-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    7

    Re: Unsure how to ask this

    Thank you for such a quick answer. Solved!
    Last edited by AliGW; 01-03-2019 at 09:35 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    23,676

    Re: Unsure how to ask this

    In future, please use more informative thread titles, along the lines of the amendment made above. Thanks.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    Are you new to Power Query and don't know what to do with the code you've been given? Have a look here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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