ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Shorten the formula (https://www.excelbanter.com/excel-worksheet-functions/191827-shorten-formula.html)

Steved

Shorten the formula
 
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.

Dave Peterson

Shorten the formula
 
=IF($A45="COMMENDATION",SUM('Complaints and Commendations'!$C12:$d12),0)

Steved wrote:

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.


--

Dave Peterson

Bernard Liengme

Shorten the formula
 
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.



Steved

Shorten the formula
 
Thankyou.

"Dave Peterson" wrote:

=IF($A45="COMMENDATION",SUM('Complaints and Commendations'!$C12:$d12),0)

Steved wrote:

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.


--

Dave Peterson


Steved

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.





All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com