How can I automate a subtraction
Best Answer

Are you wanting to put it in the cell containing the "40"? Are you only wanting to subtract new rows added below "Location"?
Answers

You can just create a formula for taking the count of all of the rows in a sheet and deduct the count from a set value.
Hope that help!
Ryan

Are you wanting to put it in the cell containing the "40"? Are you only wanting to subtract new rows added below "Location"?

Thanks Ryan and Paul.
Yes I want to subtract a number from cell containing "40" each time a row is add to the below location. If possible to subtract a number from different sheet every time a row is added to below location will also be great.
Thanks

How is the number 40 generated. Is that a manual entry for a starting point?
Can you clarify what you mean by
"subtract a number from different sheet every time a row is added to below location"
Is the row being added to a different sheet or the same sheet as the 40?

Hey Paul,
The number 40 is manually entered. It is from a different sheet. If it is not possible to do the automation from a different sheet then I can manage it on same sheet.
Thanks again.

It can be done. I just want to make sure I understand where each data piece is coming from.
Where are the new rows being added?

the new rows are added manually for now. and there is another sheet that contains the total inventory ("40").

But WHERE are the new rows added? The same sheet as the calculation you want or the other sheet?

From other sheet.

Ok. So you are staring with the number 40 on a different sheet and you want to subtract 1 for each row that is added to that other sheet. Then you want that number pulled to the sheet shown in your screenshot?
Sorry for all of the questions. I just want to make sure I completely understand what you are wanting to accomplish.

Thanks for your time and appreciated it.
Sorry for not being clear enough.
I have two sheets. One is called Machine Sheet, where rows are add and other is called inventory sheet, where total numbers are.
I want to subtract 1 from inventory sheet each time a row is add to the machine sheet.
Thanks again.

Ok. That's perfect. Thanks for the clarification, and sorry I was struggling to understand your process.
So is there some sort of criteria such as a machine type that needs to be taken into account?

Yes. We have different types of machines.

Ok. So you are going to want to use something along the lines of...
=40  COUNTIFS({Machine Sheet Machine Type Column}, "Machine Type")

Thanks Paul. Very helpful.
Help Article Resources
Categories
Check out the Formula Handbook template!