SUM or +

methody

Well-known Member
Joined
Jun 17, 2002
Messages
857
Hi
I have one very large range of data and another of the same size. I need to add the corresponding cells in each range to create another range of the same size with the sum of the corresponding cells.

I am currently using a simple SUM(A1, A10000) function. In terms of the speed and size of the file is it better to use =A1+A10000.

thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
SUM(A1, A10000) is more reliable, A1+A10000 will give you a #VALUE! error if either cell contains text (including formula blanks).

In terms of speed and size, the difference (if any) will likely be negligible.
 
Upvote 0
Solution
SUM(A1, A10000) is more reliable, A1+A10000 will give you a #VALUE! error if either cell contains text (including formula blanks).

Not entirely correct. As usual, the answer is: it depends.

Consider an example where A1 contains the text "123000" and A2 contains the text "456".

SUM(A1,A2) results in zero, whereas A1+A2 results in the number 123456.

So, the plus operator ("+") works with text that Excel can interpret as a number (includes some forms of currency, dates, times and percentages).

The SUM function ignores all text, including text that could be interpreted as a number.
 
Upvote 0
Not entirely correct.
It was entirely correct as stated. I said "if either cell contains text", not "if either cell contains a number formatted as text"

Using your interpretation, neither of the methods is appropriate. The SUM function will ignore "numbers formatted as text" whilst A1+B1 will error if the text cannot be coerced into a numeric value.

If we are to allow for all possibilities then it would need to be more like =IFERROR(VALUE(A1),0)+IFERROR(VALUE(B1),0)

As with many threads, we could spend all day looking for things that are not there. I tend to omit bad problems that could be caused by bad practice, such as numbers formatted as text, ( in simple questions from established members) unless there is an obvious reason to allow for them. In this case, either errors, or zero results when values are expected would stand out and prompt the OP to ask additional questions.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top