Forum Discussion

Xnex66's avatar
Xnex66
Copper Contributor
Jun 08, 2021
Solved

Can I use an "IF" function to return a "0" if true and to perform a calculation if not true

Hello, I am attempting to write a formula which takes an inventory number which I input and compares it with what is expected to be on hand. If my count matches what is expected to be on hand then th...
  • Riny_van_Eekelen's avatar
    Jun 08, 2021

    Xnex66 Something like this?

    =IF(H6>G6,H6-G6,0)

    This calculates H6-G6 if H6 is greater than G6. Anything else returns 0.

     

    Or a more funky formula could be:

    =(H6-G6)*--(H6>G6)

     

Resources