View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steved Steved is offline
external usenet poster
 
Posts: 519
Default Shorten the formula

Hello Bernard

It's one off those day's I just was'nt thinking

I Thankyou.

"Bernard Liengme" wrote:

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
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Steved" wrote in message
...
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.