#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Sum Function

I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?
  #2   Report Post  
Posted to microsoft.public.excel.misc
dlw dlw is offline
external usenet poster
 
Posts: 510
Default Sum Function

on my execl, sum(-a1:a5) results in an error message

"mchazka" wrote:

I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Sum Function

I don't know why you got -3 but to get the correct result -15 you need to
array enter the formula

ctrl + shift & enter


--


Regards,


Peo Sjoblom


"mchazka" wrote in message
...
I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default Sum Function

My Excel 2007 returns -1. I think the correct answer is like the punch line
to the old doctor joke, "Don't do that."

"mchazka" wrote:

I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Sum Function

XL 2007 returns -5 for me. But I agree, its a case of "don't do it"
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Ed Cones" wrote in message
...
My Excel 2007 returns -1. I think the correct answer is like the punch
line
to the old doctor joke, "Don't do that."

"mchazka" wrote:

I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Sum Function

Hi

It returns -1 for me.
This is quite understandable. If you wanted the sum of the numbers as a
negative, then the formula should be =-SUM(A1:A5) which would return -15

Having the negative inside the bracket, causes Excel to apply the minus, but
only to the first cell in the range and then stop.
If you entered it as an array formula
{=SUM(-A1:A5)}
then Excel would return -15.
As an Array formula, Excel would make each cell negative in the range, prior
to summing them.

Array formulae are entered or edited using Control+Shift+Enter (CSE) not
just Enter.
When you use CSE, Excel inserts the curly braces { } around your
formula. Do not type them yourself.

--

Regards
Roger Govier

"mchazka" wrote in message
...
I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Sum Function

I put 1, 2, 3, 4, 5 in A1:A5
I put the same formula: =sum(-a1:a5) in B1:B5 (all the same formula).

I got
-1 in B1
-2 in B2
-3 in B3
-4 in B4
-5 in B5

I think it has something to do with implicit indexing--something that I try to
avoid at all costs.

Entering all the formulas using ctrl-shift-enter resulted in -15 (for all of
them).

mchazka wrote:

I accidently came across this function : sum(-a1:a5). Suppose cells a1:a5
contains 1,2,3,4,5. The returned value is -3. How does Excel derive this
value based on the formula?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 11:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"