# excel piecewise functions

• Jun 29th 2009, 01:44 AM
luysion
excel piecewise functions
hey is there any way of making a piecewise function on excel without the use of 3rd party products?
i want to add two linear trend line to different parts of my data
• Jun 29th 2009, 05:56 AM
apcalculus
Quote:

Originally Posted by luysion
hey is there any way of making a piecewise function on excel without the use of 3rd party products?
i want to add two linear trend line to different parts of my data

See if this google hit helps, scroll a couple of pages down:

http://faculty.mc3.edu/whunter/excel...0FUNCTIONS.doc
• Jun 29th 2009, 01:48 PM
awkward
Quote:

Originally Posted by luysion
hey is there any way of making a piecewise function on excel without the use of 3rd party products?
i want to add two linear trend line to different parts of my data

Check out the IF function.

For example, if you want

$\displaystyle f(x) = 2x+3 \text{ if } x < 3$
$\displaystyle = 3x-8$ otherwise,

and x is in cell A1, then the function would be

=IF(A1<3, 2*A1+3, 3*A1-8)