Quantity deduction workaround

Joseph Aloysias
Joseph Aloysias ✭✭✭✭
edited 06/14/23 inFormulas and Functions

I want to deduct the total "quantity requested" in the "final stock of inventory" after selected the "collected" check box

and also wanted to show the available stock before confirming the order, Please help me with the workaround/ formula to achieve this

Currently I use this formula, =[Initial Stock]@row - IF(Collected@row, 0, SUMIF([Item Name]$1:[Item Name]@row, [Item Name]@row, [Total Quantity Requested]$1:[Total Quantity Requested]@row)) but its not working as expected

image.png


Tags:

Answers

  • Joseph Aloysias
    Joseph Aloysias ✭✭✭✭

    I want to minus the total qunatity requested from final stock of inventory if the collected checkbox is checked, if the checkbox is not selected then it should show the remaining quantity but here final stock of inventory and available stock-before calculation is not right, i have been trying hard to solve this issue. please help me with the right formula.

    using this formula in "final stock of inventory" : =[Initial Stock]@row - IF(Collected@row, SUMIF([Item Name]$1:[Item Name]@row, [Item Name]@row, [Total Quantity Requested]$1:[Total Quantity Requested]@row))

    this formula in - available stock-Before : =IF(Collected@row, [Final Stock of Inventory]@row + [Total Quantity Requested]@row, [Final Stock of Inventory]@row)

    @Paul Newcome@Genevieve P.@SoS | Dan PalencharPLEASE HELP!

    image.png


  • Hollie Green
    Hollie Green ✭✭✭✭✭
    edited 06/14/23

    For the Final Stock Inventory Column, if I am understanding correctly you are wanting to subtract the total requested inventory from the row above that is checked from the initial stock and if the collected box is not check you want it to show the quantity that was available on the last row where the checked box occured.

    If I am understanding correctly the below formula should work -@Domnic Victoredited formula if you saw before forgot to include the item name criteria.

    =[Initial Stock]@row - SUMIFS([Total Quantity Requested]$1:[Total Quantity Requested]@row, Collected$1:Collected@row, 1, [Item Name]$1:[Item Name]@row, [Item Name]@row)

  • Hollie Green
    Hollie Green ✭✭✭✭✭

    For the Available Stock - Before, if I am understanding correctly and you want it to add the Total Quantity requested and the Final Stock inventory if the box is checked and if the box is not checked then put the Final Stock Inventory then the below formula should work.

    =IF(Collected@row = 1, [Total Quantity Requested]@row + [Final Stock Inventory]@row, [Final Stock Inventory]@row)

  • Joseph Aloysias
    Joseph Aloysias ✭✭✭✭

    @Hollie GreenThank you so much. First formula works very well.

    但第二个公式将显示可用库存before is not working properly, Its adding the qty if the check box is unselected

    =IF(Collected@row = "1", [Final Stock of Inventory]@row, [Total Quantity Requested]@row + [Final Stock of Inventory]@row)

    Could you please check and advise

    image.png


  • Hollie Green
    Hollie Green ✭✭✭✭✭

    You have it backwards If you look at my formula above I have the addition part of the formula right after the collected@row=1 and you have it at the end. The order matters in an If formula.

  • Joseph Aloysias
    Joseph Aloysias ✭✭✭✭

    yeah, that's working. Thanks a lot

    Another one thing is I want to bring the final stock of inventory to inventory master sheet to show the remaining qty

    =IFERROR(INDEX(COLLECT({eStore: Request Sheet - Final Stock of Inventory}, {E-Store: Request Sheet - Item Name}, @cell = [Item Name]@row), COUNTIFS({E-Store: Request Sheet - Item Name}, @cell = [Item Name]@row)), [Total Stock Qty]@row)

    I used the above formula to get it but I get #INVALID COLUMN VALUE error if the items are not available in the request sheet

    image.png


  • Joseph Aloysias
    Joseph Aloysias ✭✭✭✭

    Hi, I would like to subtract quantity from final stock of inventory if the collected checkbox is checked, =IF(Collected@row = "1", [Final Stock of Inventory]@row, [Total Quantity Requested]@row + [Final Stock of Inventory]@row) I used this formula to calculate but the problem here is if I select the check box for the last order(ORD0285) the previous quantity is not showing correct, can you please help with the right formula,

    image.png


  • Joseph Aloysias
    Joseph Aloysias ✭✭✭✭

    @Hollie Greenplease help! the previous order is not showing the right quantity.

    The idea is to subtract the quantity if the collected checkbox is checked, I want to show what was available before and after the order, please help me with the workaround

  • Hollie Green
    Hollie Green ✭✭✭✭✭

    What should it be showing? It looks accurate to me as before ORD0284 there were 5 available and ORD0284 has not been collected so the amount available after that order should still be 5

  • Joseph Aloysias
    Joseph Aloysias ✭✭✭✭

    after checking the collected checkbox the final stock of inventory is "2" but ord262,ord263,ord264,ord283 its still showing "5" correct me if i'm wrong

  • Hollie Green
    Hollie Green ✭✭✭✭✭

    It depends on what you are wanting the final stock column to say.

    From my understanding you wanted it be what the final stock was after that particular order with them going in order. If you want the final stock number to drop based on all collected orders regardless if the Order was placed before or after that order then it would be a different formula and all of the final stock number would be the same number which in your example would be 2 including on rows ORDO260 and ORD0261

    The formula for that would be =[Initial Stock]@row - SUMIFS([Total Quantity Requested]:[Total Quantity Requested], [Item Name]:[Item Name], =[Item Name]@row, Collected:Collected, =1)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
The problem is the mix of data types in the serial number column. You will need to add a helper column (can be hidden after setting up) that converts every row within that column into text and then reference this in your formula.<\/p>

=[Serial #]@row + \"//m.santa-greenland.com/community/discussion/106433/\"<\/p>

=[Column Name]@row plus quote quote<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":110909,"type":"question","name":"MULTIPLE IF FORMULA AROUND DATES","excerpt":"Hi: Can anyone help with a Multiple If formula which i cannot get to work please? I have a Valid To Culumn with a date in it and have a Status Column i want toi flag as CURRENT, EXPIRING or EXPIRED depending on the date. I had CURRENT & EXPIRED working but when i try to include the additional IF to show as EXPIRING if the…","snippet":"Hi: Can anyone help with a Multiple If formula which i cannot get to work please? I have a Valid To Culumn with a date in it and have a Status Column i want toi flag as CURRENT,…","categoryID":322,"dateInserted":"2023-09-28T10:01:20+00:00","dateUpdated":null,"dateLastComment":"2023-09-28T10:26:39+00:00","insertUserID":141269,"insertUser":{"userID":141269,"name":"Fialko66","url":"https:\/\/community.smartsheet.com\/profile\/Fialko66","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T10:24:41+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":141269,"lastUser":{"userID":141269,"name":"Fialko66","url":"https:\/\/community.smartsheet.com\/profile\/Fialko66","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T10:24:41+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":22,"score":null,"hot":3391793279,"url":"https:\/\/community.smartsheet.com\/discussion\/110909\/multiple-if-formula-around-dates","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110909\/multiple-if-formula-around-dates","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":110909,"commentID":397374,"name":"Re: MULTIPLE IF FORMULA AROUND DATES","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397374#Comment_397374","dateInserted":"2023-09-28T10:26:39+00:00","insertUserID":141269,"insertUser":{"userID":141269,"name":"Fialko66","url":"https:\/\/community.smartsheet.com\/profile\/Fialko66","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T10:24:41+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-09-28T10:25:42+00:00","dateAnswered":"2023-09-28T10:22:57+00:00","acceptedAnswers":[{"commentID":397373,"body":"

Hi @Fialko66<\/a>,<\/p>

Try this:<\/p>

=IF(AND([Valid To Date]@row < TODAY(30), [Valid To Date]@row > TODAY()), \"EXPIRING\", IF([Valid To Date]@row >= TODAY(), \"CURRENT\", \"EXPIRED\"))<\/p>

Sample:<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n

Hope this helps - if I've misunderstood something or you've problems\/questions then just post! 🙂<\/span><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":110844,"type":"question","name":"Vendor management and ID #","excerpt":"I would like to assign unique vendor IDs in a database according to vendor type (independent column) and sequential numbering. Screenshot of what I am trying to produce below. I have found that the Auto Number column type only accepts a fixed prefix and thus cannot populate different prefixes based on Vendor Type along…","snippet":"I would like to assign unique vendor IDs in a database according to vendor type (independent column) and sequential numbering. Screenshot of what I am trying to produce below. I…","categoryID":322,"dateInserted":"2023-09-27T10:15:28+00:00","dateUpdated":null,"dateLastComment":"2023-09-28T06:37:03+00:00","insertUserID":161575,"insertUser":{"userID":161575,"name":"LGraf","url":"https:\/\/community.smartsheet.com\/profile\/LGraf","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T06:26:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":161575,"lastUser":{"userID":161575,"name":"LGraf","url":"https:\/\/community.smartsheet.com\/profile\/LGraf","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T06:26:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":42,"score":null,"hot":3391694551,"url":"https:\/\/community.smartsheet.com\/discussion\/110844\/vendor-management-and-id","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110844\/vendor-management-and-id","format":"Rich","lastPost":{"discussionID":110844,"commentID":397365,"name":"Re: Vendor management and ID #","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397365#Comment_397365","dateInserted":"2023-09-28T06:37:03+00:00","insertUserID":161575,"insertUser":{"userID":161575,"name":"LGraf","url":"https:\/\/community.smartsheet.com\/profile\/LGraf","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-28T06:26:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/2R63S9Z7G5M2\/screenshot-2023-09-27-105524.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Screenshot 2023-09-27 105524.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-09-27T12:47:39+00:00","dateAnswered":"2023-09-27T11:37:40+00:00","acceptedAnswers":[{"commentID":397184,"body":"

Hi @LGraf<\/a> <\/p>

Have an auto number column with the number only, then have your Vendor ID # combine it with the Vendor Type:<\/p>

=[Vendor Type]@row +\"-\"+ [Autonumber column]@row <\/p>

Unfortunately I don't think there is a way to have a dynamic prefix in the auto number column itself.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Formulas and Functions