Jun 07 2021 09:04 PM
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 the gross sales would return a zero but if my hand count comes up less than what is expected to be on hand the formula would subtract what I counted from what is expected to be on hand and tell me the amount sold.
Ex. on my spreadsheet "gross inventory" is equal to opening inventory plus additional inventory received. That value is stored in cell G6. In cell H6 I input my physical count of inventory. So, if G6 = 500 and my count (H6) = 500 then I want I6 to =0. I can make that work fine on my sheet. But IF G6 (Gross inventory) is greater than H6 (hand counted inventory) I want I6 to compute the difference. So, cell I6 would either be 0 or the difference between G6 and H6. An
Jun 07 2021 09:17 PM
Solution@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)
Jun 07 2021 09:26 PM
Jun 07 2021 09:27 PM
@Xnex66 Glad it worked!
Jun 07 2021 09:17 PM
Solution@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)