Forum Discussion

Bill_Van's avatar
Bill_Van
Copper Contributor
Sep 27, 2021

How to display a percentage value only if greater than zero

What is the correct formula to use if I need the percentage of two different cells to be displayed in a third cell only if the value is greater than zero?  And, if the value is less than zero, I need a "0%" to be displayed.  Thank you for any help that can be given.

3 Replies

  • Bill_Van 

    Since I perform all Excel calculation with defined Names and array formulas, MAX is a bit of a no go.

    = LET(
      percent, (new-base)/base,
      IF(percent>0, percent, 0))

    That is, of course, unless I push the boat out and adopt the soon to be released Lambda functions with

    = MAP(base,new,
        LAMBDA(b,n,
          MAX((n-b)/b,0)))

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Bill_Van That could be:

    =(B1/A1-1)*--(B1>A1)

    where B1 contains the value that should be greater that A1 for the formula to return a percentage other than 0%.

Resources