Hi all, I have the following formula which I'd like to improve/shorten by using an OR statement rather than having to sum two 'parts'. Although the formula works in it's current format, as I add more criteria too it, it because too long for excel to handle.
{=SUM(IF(ISNUMBER('Caseload'!$A$2:$A$10000),(DATE(YEAR($H$8),MONTH($H$8)+1,0)>='Caseload'!$AC$2:$AC$10000)*("Previously attended"='Caseload'!$AF$2:$AF$10000)))+SUM(IF(ISNUMBER('Caseload'!$A$2:$A$10000),(DATE(YEAR($H$8),MONTH($H$8)+1,0)>='Caseload'!$AC$2:$AC$10000)*("Currently attending"='Caseload'!$AF$2:$AF$10000)))}
What I'm trying to achieve is the following:
if 'Caseload'!$A$2:$A$10000 is a number (which will ALWAYS be the case)
then
count the number of records where the date they were taken on to the caseload is less than the final day in the reporting month (see note 1)
and the individual was 'previously attending' the clinic
or the individual is 'currently attending' the clinic.
note 1 - given the 1st of the month is always used whenever a user inserts a month and year, for example, 01/03/2011 would be used if the user typed 'Mar-11' in to excel, the following formula returns the last day in march and compares it to the date the individual was taken on to caseload: (DATE(YEAR($H$8),MONTH($H$8)+1,0)>='Caseload'!$AC$2:$AC$10000)
So you can see that the two 'parts' of my formula only differ by the use of 'currently attending' and 'previously attended'.
Is there a way of combining this by using an OR statement?
I've tried using a sumproduct, but couldn't get that to work seen as though I'm not returning or summing any values - I just want to count the number of records matching this criteria.
Thanks.
{=SUM(IF(ISNUMBER('Caseload'!$A$2:$A$10000),(DATE(YEAR($H$8),MONTH($H$8)+1,0)>='Caseload'!$AC$2:$AC$10000)*("Previously attended"='Caseload'!$AF$2:$AF$10000)))+SUM(IF(ISNUMBER('Caseload'!$A$2:$A$10000),(DATE(YEAR($H$8),MONTH($H$8)+1,0)>='Caseload'!$AC$2:$AC$10000)*("Currently attending"='Caseload'!$AF$2:$AF$10000)))}
What I'm trying to achieve is the following:
if 'Caseload'!$A$2:$A$10000 is a number (which will ALWAYS be the case)
then
count the number of records where the date they were taken on to the caseload is less than the final day in the reporting month (see note 1)
and the individual was 'previously attending' the clinic
or the individual is 'currently attending' the clinic.
note 1 - given the 1st of the month is always used whenever a user inserts a month and year, for example, 01/03/2011 would be used if the user typed 'Mar-11' in to excel, the following formula returns the last day in march and compares it to the date the individual was taken on to caseload: (DATE(YEAR($H$8),MONTH($H$8)+1,0)>='Caseload'!$AC$2:$AC$10000)
So you can see that the two 'parts' of my formula only differ by the use of 'currently attending' and 'previously attended'.
Is there a way of combining this by using an OR statement?
I've tried using a sumproduct, but couldn't get that to work seen as though I'm not returning or summing any values - I just want to count the number of records matching this criteria.
Thanks.
Last edited: