I have the following formula.
=IF(N$2>ActualsEndDate, IF(ReturnsBasis="Cashflow",SUMIFS(Units!YL$10:YL$320,Units!YL$10:YL$320,">"&0,Units!$C$10:$C$320,$C78), IF(ReturnsBasis="Income",SUMIFS(Units!DBN$10:DBN$320,Units!DBN$10:DBN$320,">"&0,Units!$C$10:$C$320,$C78),0))...