I am trying to find a provider for a patient using the following conditions:
-if seen by multiple providers, choose the one with the most visits, then choose most recent visit
-if equal number of visits by providers, then choose most recent
This is the last formula I have started to work with:
=IF(AND(MAX(COUNTIF($K$2:$K$876,K2)),($M$2:$M$876="Newest")),"x","")
The problem with this, is it only considers those with "Newest" in column M. The formula needs to consider the conditions above, specifically, to choose the most visits, then most recent.
I am attempting to place an "x" in column N under "Select"
Here is a sample file:
https://docs.google.com/spreadsheet/ccc?key=0Atek2wjie2YLdC1WTENNME1Wb2xGZ1daV3lEaVpMYXc&usp=sharing
-if seen by multiple providers, choose the one with the most visits, then choose most recent visit
-if equal number of visits by providers, then choose most recent
This is the last formula I have started to work with:
=IF(AND(MAX(COUNTIF($K$2:$K$876,K2)),($M$2:$M$876="Newest")),"x","")
The problem with this, is it only considers those with "Newest" in column M. The formula needs to consider the conditions above, specifically, to choose the most visits, then most recent.
I am attempting to place an "x" in column N under "Select"
Here is a sample file:
https://docs.google.com/spreadsheet/ccc?key=0Atek2wjie2YLdC1WTENNME1Wb2xGZ1daV3lEaVpMYXc&usp=sharing