I have a workbook that contains two worksheets: sheet 1 is a control list and sheet 2 uses sumproduct to get info from constrol list. The following formula is in sheet 2.

Is it possible to convert the following Excel formula to user defined function?


IF(SUMPRODUCT(('ControlList'!$N:$N=G$3)*('ControlList'!$R:$R=$A5),'ControlList'!$A:$A)>0,SUMPRODUCT(('ControlList'!$N:$N=G$3)*('ControlList'!$R:$R=$A5),'ControlList'!$A:$A),"")

Thank you in advance.