[Tfug] oo.org spreadsheet formula question.

Josh Miller joshnmiller at earthlink.net
Wed Jul 6 16:49:50 MST 2005


I agree that the "adding two numbers" way seems like it should be more 
efficient.

The question interested me for some reason, so I ran a test.

Using OpenOffice 1.9.79, I produced a column of 8000 small integers in 
column C.

In D1, I put the formula "=SUM($c$1:c1)", copied it, and pasted to 
D2-D8000, and measured the time it took for the spreadsheet to recalc 
using a sophisticated method I call "counting".

Then I measured the =D1+C2 method similarly

Calc time for SUM : 21 secs
Calc time for +  : 14 secs

So it seems your suspicions are correct - adding two numbers is more 
efficient than summing a column.


-Josh

Jim Secan wrote:
> At 03:49 PM 7/6/2005 -0700, Josh wrote:
> 
>>Another way to do this:
>>
>>D1:	=SUM($C$1:C1)
> 
> 
> Unless the spreadsheets are smarter than I think they are, the approach of
> adding the cell in C on the row of interest to the cell in D in the
> previous row is more efficient.  In this approach, you're just adding two
> numbers together.  In the approach using the SUM() function you are adding
> together an increasing number of cells as the overall list becomes longer.
> Now perhaps the spreadsheet is smart enough to see what you're doing and
> optimize, but that would surprise me.
> 
> It may also be the case that in these days of GHz processors this
> efficiency is down in the noise level, but old habits die hard.
> 
> Jim
> *---------------------*-------------------------------*
> | Jim Secan           | Northwest Research Assoc, Inc |
> | (jim at nwra.com)      | 2455 E. Speedway, Suite 204   |
> | (520) 319-7773      | Tucson, Arizona 85719         |
> |    Space Weather Info: http://www.nwra-az.com/      |
> *---------------------*-------------------------------*
> _______________________________________________
> tfug mailing list
> tfug at tfug.org
> http://www.tfug.org/mailman/listinfo/tfug
> 


More information about the tfug mailing list