A little help...Is it possible in Algebra....

Mikkey

New member
Joined
Jul 26, 2016
Messages
2
Hello hello....

I am trying to convert what is essentially an excel formula to written maths, if it is at all possible. Unfortunately I am far from being competent in mathematics, so I am turn to your wisdom for assistance!

Essentially, I have a formula in Excel...that...

if a>0 then the value of b is determined by equation Y
else the value of b is determined by equation Z.

The actual formula is this: =IF(C14>0,J14,K14)

It's the typical "IF" function in Excel, Open office...etc....

Ideally, what I would look for is an equation that would say if a>0 then value of b is determined by equation Y. If a<0 then value of b is determined by equation Z.

Can this expression be rewritten using algebra / maths symbols?

If this is possible, there will be multiple instances of this, and I would like to make an average...so summing up all the values and dividing by the number of instances.

Can this be integrated into any equation?

Many thanks in advance for any help!

Best

M
 
Yes, mathematics has a concept that describes this. It is called a piecewise defined function. Just to make up an example, let's say we have a variable n. If it's negative, the function evaluates to n/2. If n is positive (or 0), the function instead evaluates to 2n.

\(\displaystyle \displaystyle f(n) = \begin{cases} n/2 &\mbox{if } n < 0 \\ 2n & \mbox{if } n \ge 0 \end{cases}\)
 
Yes, mathematics has a concept that describes this. It is called a piecewise defined function. Just to make up an example, let's say we have a variable n. If it's negative, the function evaluates to n/2. If n is positive (or 0), the function instead evaluates to 2n.

\(\displaystyle \displaystyle f(n) = \begin{cases} n/2 &\mbox{if } n < 0 \\ 2n & \mbox{if } n \ge 0 \end{cases}\)

Thank you for that. It's very helpful.

So in my case, I guess that the function would be something like:

\(\displaystyle \displaystyle f(a) = \begin{cases} Equation Y &\mbox{if } a < 0 \\ Equation Z & \mbox{if } a \ge 0 \end{cases}\)

Does that mean then that I can say something like:

But does that mean I can then write:

\(\displaystyle \displaystyle b = f(a) = \begin{cases} Equation Y &\mbox{if } a < 0 \\ Equation Z & \mbox{if } a \ge 0 \end{cases}\)?

And as for the next stage...say I have multiple instances of this single event...with the values changing each time...

Is there a way I can include an averaging function within the equation...or would it have to be separate?

Many thanks for your help!

Mikkey
 
Top