subtract function

R

Raymond

what is the syntax for a subtract function? For example, the syntax for the
sum function looks like this: =sum()

Thanks
 
B

Bill Martin

what is the syntax for a subtract function? For example, the syntax for
the
sum function looks like this: =sum()

How about = -sum()

Bill -- (Remove KILLSPAM from my address to use it)
 
B

Bernard Liengme

Or A1-SUM(B1:D5) in place of A1-B1-C1-D1
It's all mathematical slight of hand!
 
M

Myrna Larson

I think what you proposed is called negation, not subtraction, no?

SUM(A1:B1) adds the value in B1 to that in A1.

I think he wants to *subtract* B1 from A1, i.e. =A1-B1, or =A1+(-B1), which is
not the same as -SUM(A1:B1).
 
D

Dave Peterson

Just a typo:

=A1-SUM(B1:D5) in place of A1-B1-C1-D1
should be:
=A1-SUM(B1:D1) in place of A1-B1-C1-D1
 
A

AlfD

Hi folks!

What did OP mean by " subtract function"?

Shall we ask ?
I think so.


Raymond:

What do you think a subtract function is or does?

Al
 
M

Myrna Larson

I understood him to mean the converse of SUM, which adds. Subtraction would
subtract. The problem with the whole concept is that a SUBTRACT function would
probably be limited to 2 arguments, and in that case, it's a bit silly:
=SUBTRACT(A1,B1) vs =A1-B1
 
A

AlfD

Hi!

Exactly.

Subtraction is a 2-argument operation: addition isn't. Similarly
division is a 2-argument function: multiplication isn't .

Alf

Al
 
R

Raymond

I just want to look for the subtract function the way the sum function is
easily found by clicking on the Z. In that way, I don't have to type in the
syntax, but just press the control key and click on the cells I want to
subtract or minus. However, I could not find the function by clicking more
function.

Thanks
 
R

RagDyer

I start the month with 100 lbs. of Red dye.
I use 2lbs. on the first of the month,
8 on the second,
4 on the third,
16 on the fourth,
etc....

Why is this *not* a multi-argument subtraction for inventory?

Same as *buying* 6 lbs. on the first,
9 lbs. on the second,
11 lbs. o n the third,
etc...

What's the difference? ... Semantics?

--


Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------


Hi!

Exactly.

Subtraction is a 2-argument operation: addition isn't. Similarly,
division is a 2-argument function: multiplication isn't .

Alf

Alf
 
M

Myrna Larson

Since order of the arguments matters with subtraction (but not addition), in
the case you cite, you would have to require that the first argument is to be
treated as the minuend, and all other arguments are subtrahends. But what if
somebody wanted to add the 1st and 2nd together, then subtract the other
arguments? You couldn't devise a single function that would handle both cases
(or any of the other myriad possibilities).
 
M

Myrna Larson

There are functions for SUM and PRODUCT, where the order of the arguments
doesn't matter. There is no SUBTRACT function; there's also no DIVIDE
function. You accomplish operations like this with with "operators", - to
subtract, / to divide.
 
D

Dana DeLouis

I would go with Dave's suggestion.
If A1:A5 had the numbers: 100, 2, 8, 4, 16

a slight variation could be the following array formula where you group the
pos. and neg. numbers.
{=SUM(A1,-A2:A5)}

Returns 70.
for 100-2-8-4-16

Dana DeLouis
 
M

Myrna Larson

If the OP is at the level of learning how to subtract, I think array formulas
might better be postponed for a while <vbg>.
 
B

Bill Martin

I think what you proposed is called negation, not subtraction, no?
SUM(A1:B1) adds the value in B1 to that in A1.

I think he wants to *subtract* B1 from A1, i.e. =A1-B1, or =A1+(-B1), which is
not the same as -SUM(A1:B1).

--------------

It depends on what he really wanted which was unclear to me. The SUM()
produces a result equivalent to:

SUM (A1:C1) = 0 + A1 + B1 + C1

The negation function I provided provides the result:

-SUM(A1:C1) = 0 - A1 - B1 - C1

You are presuming that he wants to add A and subtract the rest. I'm
presuming he wants to subtract everything. I don't know which he really
wanted. Maybe he knows and will speak up?

Bill -- (Remove KILLSPAM from my address to use it)
 
M

Myrna Larson

I guess you can call it subtraction if it's OK to add an argument (the 1st
zero) that the user didn't specify <g>.
 
Top