ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Why should you never use '=sum(A1+A2)'? (https://www.excelbanter.com/new-users-excel/38635-why-should-you-never-use-%3Dsum-a1-a2.html)

Ted Rogers

Why should you never use '=sum(A1+A2)'?
 
I attended an Excel training course yesterday and looking through the
handout this morning noticed these lines in the overview:

'.......when to use '=A1+A2' and when to use '=sum(A1:A10)' and why you
should never use '=sum(A1+A2)'. I can't for the life of me remember the
trainer's explanation and can't find the answer anywhere. Could anyone help
please?

Ted



JE McGimpsey

The SUM() function is superfluous in this case. Example:

A1: 5
A2: 6
A3: =A1 + A2 ==== 11
A4: =SUM(A1 + A2) === SUM(11) ==== 11


In article ,
"Ted Rogers" wrote:

I attended an Excel training course yesterday and looking through the
handout this morning noticed these lines in the overview:

'.......when to use '=A1+A2' and when to use '=sum(A1:A10)' and why you
should never use '=sum(A1+A2)'. I can't for the life of me remember the
trainer's explanation and can't find the answer anywhere. Could anyone help
please?


Bob Phillips

Because you are effectively trying to do the same command twice

A1+A2 is summing those two cells,
SUM is also saying to sum them

You get the correct answer because the A1+A2 is resolved before the SUM acts
upon it, but it is unnecessary, and will be inefficient in a large
spreadsheet.

--
HTH

Bob Phillips

"Ted Rogers" wrote in message
...
I attended an Excel training course yesterday and looking through the
handout this morning noticed these lines in the overview:

'.......when to use '=A1+A2' and when to use '=sum(A1:A10)' and why you
should never use '=sum(A1+A2)'. I can't for the life of me remember the
trainer's explanation and can't find the answer anywhere. Could anyone

help
please?

Ted





Dave Peterson

=sum() ignores cells with text in them:

A1: ASDF
A2: 3

=sum(a1:a2) will return 3
=sum(a1+a2) will return a #value! error
(because a1+a2 will return a #value! error)


Ted Rogers wrote:

I attended an Excel training course yesterday and looking through the
handout this morning noticed these lines in the overview:

'.......when to use '=A1+A2' and when to use '=sum(A1:A10)' and why you
should never use '=sum(A1+A2)'. I can't for the life of me remember the
trainer's explanation and can't find the answer anywhere. Could anyone help
please?

Ted


--

Dave Peterson

Ted Rogers


"Dave Peterson" wrote in message
...
=sum() ignores cells with text in them:

A1: ASDF
A2: 3

=sum(a1:a2) will return 3
=sum(a1+a2) will return a #value! error
(because a1+a2 will return a #value! error)

Many thanks to everyone for your kind help - I appreciate it.

Ted




All times are GMT +1. The time now is 05:42 PM.

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