Dim A1 As String
Dim D2 As String
Dim E2 As String
D2 = "=IF(SUMPRODUCT(IF(LoanNo=$J2,1,0),IF(NewPropAddress=$R2,1,0)) <10, TEXT(SUMPRODUCT(IF(LoanNo=$J2,1,0),IF(NewPropAddress=$R2,1,0)),"" 0""),SUMPRODUCT(IF(LoanNo=$J2,1,0),IF(NewPropAddress=$R2,1,0)))& "" | ""&J2"
E2 = "=SUMPRODUCT(IF(LoanNo=$J2,1,0),IF(NewPropAddress=$R2,1,0),IF(TradeRisk=""Lower"",1,0))+SUMPRODUCT(IF(LoanNo=$J2,1,0),IF(NewPropAddress=$R2,1,0),IF(TradeRisk=""Moderate"",1,0))+SUMPRODUCT(IF(LoanNo=$J2,1,0),IF(NewPropAddress=$R2,1,0),IF(TradeRisk=""Higher"",1,0))"
n = 4
If ActiveCell.Offset(0, n).FormulaArray <> D2 Then ActiveCell.Offset(0, n).FormulaArray = D2
n = n + 1
If ActiveCell.Offset(0, n).Formula <> E2 Then ActiveCell.Offset(0, n).Formula = E2