Mathematical puzzle (for all you Excel experts)

S

ship

Hi

I have a mathematical puzzle that I cant solve.

In the table below, the inputs are the values in columns "A" and "B
and the desired output is column "C".

A B C

-3 -3 0
-3 +3 -6
+3 -3 0
+3 +3 +6
0 0 0


What on earth is the formula in Microsoft Excel that creates "C"?

With thanks


Ship
Shiperton Henethe

Clue:
If you strip the sign off "A" and then add "A" and "B" together
and then apply the sign afterwards, you get the correct
answer. But how the heck do you do this in msExcel ?
And/or isnt there a better way of doing the mathematics ? (!)
 
R

Ron Rosenfeld

Hi

I have a mathematical puzzle that I cant solve.

In the table below, the inputs are the values in columns "A" and "B
and the desired output is column "C".

A B C

-3 -3 0
-3 +3 -6
+3 -3 0
+3 +3 +6
0 0 0


What on earth is the formula in Microsoft Excel that creates "C"?

With thanks


Ship
Shiperton Henethe

Clue:
If you strip the sign off "A" and then add "A" and "B" together
and then apply the sign afterwards, you get the correct
answer. But how the heck do you do this in msExcel ?
And/or isnt there a better way of doing the mathematics ? (!)


=SIGN(A1)*(ABS(A1)+B1)
--ron
 
R

Ron Coderre

....and...another:

C1: =A1+IF(A1>0,B1,-B1)

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

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
H

Harlan Grove

ship said:
In the table below, the inputs are the values in columns "A" and "B
and the desired output is column "C".

A B C

-3 -3 0
-3 +3 -6
+3 -3 0
+3 +3 +6
0 0 0

What on earth is the formula in Microsoft Excel that creates "C"?
....

Another possibility, C1: =(B1>0)*2*A1

If this is would be a differentiable function at every (x,y) point,
then none of the formulas offered so far would be correct. There's an
infinite number of polynomials in x and y that could pass through
these 5 (x,y) points.
 
D

David Biddulph

How does that work for the second example, with -3 for A, +3 for B, and -6
for the result?
 
R

Ron Rosenfeld

You get the Occam's Razor award!

As Mencken once wrote:

"There is always an easy solution to every human problem--neat,
plausible, and wrong."

"Occam's Razor" fails on example 2.
--ron
 
S

ship

=SIGN(A1)*(ABS(A1)+B1)- Hide quoted text -

- Show quoted text -


Yes, Greg I think you get the prize for the most *intuitively obvious*
solution.

i.e. in english, then
1. Keep the +ve or -ve "sign" of A
2. Then take A, and either add or subtract B from it
(irrespective of A's sign).

And yes, well done - that's exactly what I'm looking for !

thanks very much


Ship
 

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