Shorten the formula

S

Steved

Hello from Steved

This works
=IF($A45="COMMENDATION",SUM('Complaints and
Commendations'!$C12),0)+IF($A45="COMMENDATION",SUM('Complaints and
Commendations'!$D12),0)

This does'nt, What is needed please
=IF($A45="COMMENDATION",SUM('Complaints and Commendations'!{"C12","D12"}),0)
Thankyou.
 
B

Bernard Liengme

Why are you using SUM to get a single value?
=IF($A45="COMMENDATION",'Complaints and Commendations'!$C12),0)+
IF($A45="COMMENDATION",'Complaints and Commendations'!$D12),0)

So why not
=IF($A45="COMMENDATION",SUM('Complaints and Commendations'!$C12:D12),0)

OR
SUM('Complaints and Commendations'!$C12:D12)*($A45="COMMENDATION")

best wishes
 
Top