ALS function advanced

Occasional Contributor

Hi Guys, 

 

I am trying to create a formula that if D1 is greater than 0 (when i make a profit) it needs to multiply with 0,5 (so half will go to my savings and half will be added to the existing). If D1 is lower than 0 (if i make a loss) it needs to multiply with 0, so the full loss is taken into account. 

 

Test foto.jpg

 

I have played arround with the ALS function, but that wasnt succesful for me. 

 

Hope you guys know a great solution. 

4 Replies

@Marty1990 

In your screenshot, D1 does not contain a number. Did you mean C2? If so, enter the following formula in D2 (or another cell in row 2), then fill down:

 

=MAX(C2/2;0)

 

or (equivalently)

 

=MAX(C2;0)/2

@Hans Vogelaar 

 

Thanks for your quick reply and answer. 

The answer covers party wat I was after, maybe it was a little unclear in my first explination so Ill try to be more clearly. In the attaced picture I have added the D section (with the results I want to achieve). What I want to achieve with a formula is 50% of my Profit and a 100% of my loss. 

Screenshot 2022-09-07 182133.jpg

@Marty1990 

In your first post, you wrote "multiply with 0" - the result of that will always be 0.

Use this instead in D2:

 

=ALS(C2>0; C2/2; C2)

@Hans Vogelaar
Correct this is been my mistake.
The formula provided works perfectly! Many thanks for your help.