Good morning,
I have results of surveys covering 3 years.
I have been able to use sumproduct to total occasions for a selected month for a selected year
When I try to then get the number of occasions where the response is entered as "Completed" I get a zero response
Formula: for month and year
=SUMPRODUCT(IF(MONTH(INDIRECT(Lookup!$N$10))=XLOOKUP(K$2,$B$3:$B$14,$A$3:$A$14),1,0),IF(YEAR(INDIRECT(Lookup!$N$10))=K$1,1,0))
Lookup!$N$10 holds the date range
XLOOKUP(K$2,$B$3:$B$14,$A$3:$A$14) is K$2 - month selected, $B$3:$B$14 is the month names range, $A$3:$A$14 is the month number to assist lookup ( June, 6,)
INDIRECT(Lookup!$N$10)) holds the date range, K$1 = selected year
The formula gives me 8 which is correct
If I try to add - IF(INDIRECT(Lookup!$V2)="Completed ",1,0) - to count the number of occasions for June, 2024, where the response in "Completed" I get zero
=SUMPRODUCT(IF(MONTH(INDIRECT(Lookup!$N$10))=XLOOKUP(K$2,$B$3:$B$14,$A$3:$A$14),1,0),IF(YEAR(INDIRECT(Lookup!$N$10))=K$1,1,0,IF(INDIRECT(Lookup!$V2)="Completed ",1,0)))
Would you have advice on what I have wrong is "--( " required (my attempt did not work.
Thanks very much for looking at this for me.
Geoff
I have results of surveys covering 3 years.
I have been able to use sumproduct to total occasions for a selected month for a selected year
When I try to then get the number of occasions where the response is entered as "Completed" I get a zero response
Formula: for month and year
=SUMPRODUCT(IF(MONTH(INDIRECT(Lookup!$N$10))=XLOOKUP(K$2,$B$3:$B$14,$A$3:$A$14),1,0),IF(YEAR(INDIRECT(Lookup!$N$10))=K$1,1,0))
Lookup!$N$10 holds the date range
XLOOKUP(K$2,$B$3:$B$14,$A$3:$A$14) is K$2 - month selected, $B$3:$B$14 is the month names range, $A$3:$A$14 is the month number to assist lookup ( June, 6,)
INDIRECT(Lookup!$N$10)) holds the date range, K$1 = selected year
The formula gives me 8 which is correct
If I try to add - IF(INDIRECT(Lookup!$V2)="Completed ",1,0) - to count the number of occasions for June, 2024, where the response in "Completed" I get zero
=SUMPRODUCT(IF(MONTH(INDIRECT(Lookup!$N$10))=XLOOKUP(K$2,$B$3:$B$14,$A$3:$A$14),1,0),IF(YEAR(INDIRECT(Lookup!$N$10))=K$1,1,0,IF(INDIRECT(Lookup!$V2)="Completed ",1,0)))
Would you have advice on what I have wrong is "--( " required (my attempt did not work.
Thanks very much for looking at this for me.
Geoff