Forum Discussion

lherbert501's avatar
lherbert501
Post Prodigy
3 years ago

Negative Growth with 0

Hi,

 

I have a scenario which is probably quite rare, but I need to have it covered in the if statement.

Where there was £0 Profit in the previous year, a product has made a loss on current reporting year.

 

 

Growth % =
switch( TRUE(),
                [Last YTD] = 0 && [Profit] > 0, 1.00,
                [Last YTD] = 0 && [Profit] < 0,  DIVIDE([YTD - LYTD],[Last YTD])
                ,0)

 

I'm struggling with where Last YTD is 0 and the following year is a negative. Ideally that would say -3.50% above in growth but as I'm dividing by zero its blank/0. 

 

Is this possible?

 

Thanks

 

 

3 Replies

  • Please read about the third argument of the DIVIDE function.

    • lherbert501's avatar
      lherbert501
      Post Prodigy

      Hi lbendlin ,

       

      But even with an alternative result, it will return a value of etc 0.

       

      I would want it to say -3.50% in the example above.

      • lbendlin's avatar
        lbendlin
        Super User

        Then put that in there? Doesn't have to be 0.