Formula: if checkbox is checked then add or subtract
Hi everyone, I would like to have a sheet that tells me how many goods we have left in our warehouse.
The idea is that employees report via a dashboard whether they are taking something out of stock or returning something.
If one checks the column "IN" or "OUT" they also have to add the amount. That amount should be subtracted from the total quantity when taking something out of stock (if the "OUT" column is checked). The amount that they bring back must be added (if column "IN" is checked).
The formula should be in column "Quantity left".
I know this is certainly possible in smartsheet, but I can't put together the right formula.
Can anyone give me a solution or point me in the right direction.
Thanks!
Best Answer
-
The way I would do this is set up two SUMIFS statements.
One SUMIFS would Sum together all the values in the Amount column IF the "Action" matches the action in this current row and IF the IN box is checked.
The second SUMIFS would do the same, but only if the OUT box is checked.
Then once you have these two total values, you can + and - them from the Total Quantity.
Try something like this:
=[Total Quantity]@row + SUMIFS(Amount:Amount, Action:Action, Action@row, In:In, 1) - SUMIFS(Amount:Amount, Action:Action, Action@row, Out:Out, 1)
Cheers,
Genevieve
Answers
-
Instead of the dashboard, I mean form**** .
-
The way I would do this is set up two SUMIFS statements.
One SUMIFS would Sum together all the values in the Amount column IF the "Action" matches the action in this current row and IF the IN box is checked.
The second SUMIFS would do the same, but only if the OUT box is checked.
Then once you have these two total values, you can + and - them from the Total Quantity.
Try something like this:
=[Total Quantity]@row + SUMIFS(Amount:Amount, Action:Action, Action@row, In:In, 1) - SUMIFS(Amount:Amount, Action:Action, Action@row, Out:Out, 1)
Cheers,
Genevieve
-
Hey Genevieve P.
Thank you so much!!
Cheers,
Warehouse Tomorrowland
-
No problem! I'm glad I could help 🙂
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- 10.7K Get Help
- 63 Global Discussions
- 68 Industry Talk
- 385 Announcements
- 3.5K Ideas & Feature Requests
- 55 Brandfolder
- 125 Just for fun
- 50 Community Job Board
- 464 Show & Tell
- 40 Member Spotlight
- 44 Power Your Process
- 28 Sponsor X
- 234 Events
- 7.3K Forum Archives
Check out the Formula Handbook template!