Forum Discussion

Andrew58's avatar
Andrew58
Copper Contributor
Nov 06, 2023
Solved

Help with a Conditional Formula

I have written an Excel Spreadsheet that calculates a currency value in various cells based around the tax scales as income increases. The result of the sheet (total tax payable) requires the addition of several cells to give a total currency value, however I need to ignore (or not include) cells values that are negative.

I'm asking here if anyone can please tell me how to 'instruct' or 'format' a cell, so that if the result of the calculation in a cell is a negative currency values - then show the value as $0 (zero), so that the negative value is not included in the 'total tax payable' sum calculation.

I hope I explained that OK ??

  • Andrew58 One simple method would be to use the MAX function to return the maximum value between the calculation and zero. For example:

     

    =MAX(calculation, 0)
    =MAX(A1-B2, 0)
    =MAX(8-10, 0)
    =MAX(-2, 0)
    =0

     

  • Vinod2406's avatar
    Vinod2406
    Brass Contributor

    Andrew58 Hi Andrew,
    You can achieve this using a simple if statement, You can even incorporate the formula in if condition to get the result in same column.
    =IF(B4>=0,B4,0)

    • Andrew58's avatar
      Andrew58
      Copper Contributor
      Hi Vinod2406, that's brilliant. I mucked around trying something like that but you obviously need to know the exact structure/make up of the statement.
      Thanks for your help !
  • djclements's avatar
    djclements
    Bronze Contributor

    Andrew58 One simple method would be to use the MAX function to return the maximum value between the calculation and zero. For example:

     

    =MAX(calculation, 0)
    =MAX(A1-B2, 0)
    =MAX(8-10, 0)
    =MAX(-2, 0)
    =0

     

    • Andrew58's avatar
      Andrew58
      Copper Contributor
      Thanks dj, that worked & helped me a lot !

Resources