Why should you never use '=sum(A1+A2)'?

T

Ted Rogers

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
 
J

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
 
B

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.
 
D

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)
 
T

Ted Rogers

Dave Peterson said:
=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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top