Excel 2016: Return total quantity of matching part #s over multiple lines if conditions are met












0














I have 1 sheet that needs to get a total quantity of a part number from a 2nd sheet based on if other columns in the second sheet meet specific criteria.



Here is an example:



Sheet 1



Sheet 2



And I am trying to use this formula, but only get 0.



=IF(OR('SHEET2'!C:C="W", LEFT(TRIM('SHEET2'!D:D),1)="W",LEFT(TRIM('SHEET2'!D:D),1)="5"),SUMIF('SHEET2'!A:A,'SHEET1'!A:A,'SHEET2'!E:E),0)









share|improve this question
























  • One approach could be to use a Helper column putting the result of individual OR condition (Col C = W or 1st letter of Col D either W or 5) TRUE / FALSE and then using SUMIFS based on that OR result to keep it simple
    – patkim
    Dec 13 '18 at 17:49


















0














I have 1 sheet that needs to get a total quantity of a part number from a 2nd sheet based on if other columns in the second sheet meet specific criteria.



Here is an example:



Sheet 1



Sheet 2



And I am trying to use this formula, but only get 0.



=IF(OR('SHEET2'!C:C="W", LEFT(TRIM('SHEET2'!D:D),1)="W",LEFT(TRIM('SHEET2'!D:D),1)="5"),SUMIF('SHEET2'!A:A,'SHEET1'!A:A,'SHEET2'!E:E),0)









share|improve this question
























  • One approach could be to use a Helper column putting the result of individual OR condition (Col C = W or 1st letter of Col D either W or 5) TRUE / FALSE and then using SUMIFS based on that OR result to keep it simple
    – patkim
    Dec 13 '18 at 17:49
















0












0








0


0





I have 1 sheet that needs to get a total quantity of a part number from a 2nd sheet based on if other columns in the second sheet meet specific criteria.



Here is an example:



Sheet 1



Sheet 2



And I am trying to use this formula, but only get 0.



=IF(OR('SHEET2'!C:C="W", LEFT(TRIM('SHEET2'!D:D),1)="W",LEFT(TRIM('SHEET2'!D:D),1)="5"),SUMIF('SHEET2'!A:A,'SHEET1'!A:A,'SHEET2'!E:E),0)









share|improve this question















I have 1 sheet that needs to get a total quantity of a part number from a 2nd sheet based on if other columns in the second sheet meet specific criteria.



Here is an example:



Sheet 1



Sheet 2



And I am trying to use this formula, but only get 0.



=IF(OR('SHEET2'!C:C="W", LEFT(TRIM('SHEET2'!D:D),1)="W",LEFT(TRIM('SHEET2'!D:D),1)="5"),SUMIF('SHEET2'!A:A,'SHEET1'!A:A,'SHEET2'!E:E),0)






worksheet-function microsoft-excel-2016






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 13 '18 at 16:56









Scott Craner

11.2k1815




11.2k1815










asked Dec 13 '18 at 16:00









Jon DeVowe

12




12












  • One approach could be to use a Helper column putting the result of individual OR condition (Col C = W or 1st letter of Col D either W or 5) TRUE / FALSE and then using SUMIFS based on that OR result to keep it simple
    – patkim
    Dec 13 '18 at 17:49




















  • One approach could be to use a Helper column putting the result of individual OR condition (Col C = W or 1st letter of Col D either W or 5) TRUE / FALSE and then using SUMIFS based on that OR result to keep it simple
    – patkim
    Dec 13 '18 at 17:49


















One approach could be to use a Helper column putting the result of individual OR condition (Col C = W or 1st letter of Col D either W or 5) TRUE / FALSE and then using SUMIFS based on that OR result to keep it simple
– patkim
Dec 13 '18 at 17:49






One approach could be to use a Helper column putting the result of individual OR condition (Col C = W or 1st letter of Col D either W or 5) TRUE / FALSE and then using SUMIFS based on that OR result to keep it simple
– patkim
Dec 13 '18 at 17:49












1 Answer
1






active

oldest

votes


















0














I think the issue is with your range notation.



The formula is looking for products in stockroom W or a bin beginning with 5 or W on the same row that the formula is entered, regardless of the product number on that row.



For example, on Sheet1 for product number 9900400 the formula in B2 checks for the correct stockroom/bin on row 2 of Sheet2. None of the requirements are met so it evaluates to 0. However, if one of the requirements had been met it would have reported the total for 9900400, even if 9900400 is not in stockroom W or bin 5/W.



The easiest way to fix this is to make sure all Part #'s are on the same row in both sheets.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1383334%2fexcel-2016-return-total-quantity-of-matching-part-s-over-multiple-lines-if-con%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I think the issue is with your range notation.



    The formula is looking for products in stockroom W or a bin beginning with 5 or W on the same row that the formula is entered, regardless of the product number on that row.



    For example, on Sheet1 for product number 9900400 the formula in B2 checks for the correct stockroom/bin on row 2 of Sheet2. None of the requirements are met so it evaluates to 0. However, if one of the requirements had been met it would have reported the total for 9900400, even if 9900400 is not in stockroom W or bin 5/W.



    The easiest way to fix this is to make sure all Part #'s are on the same row in both sheets.






    share|improve this answer




























      0














      I think the issue is with your range notation.



      The formula is looking for products in stockroom W or a bin beginning with 5 or W on the same row that the formula is entered, regardless of the product number on that row.



      For example, on Sheet1 for product number 9900400 the formula in B2 checks for the correct stockroom/bin on row 2 of Sheet2. None of the requirements are met so it evaluates to 0. However, if one of the requirements had been met it would have reported the total for 9900400, even if 9900400 is not in stockroom W or bin 5/W.



      The easiest way to fix this is to make sure all Part #'s are on the same row in both sheets.






      share|improve this answer


























        0












        0








        0






        I think the issue is with your range notation.



        The formula is looking for products in stockroom W or a bin beginning with 5 or W on the same row that the formula is entered, regardless of the product number on that row.



        For example, on Sheet1 for product number 9900400 the formula in B2 checks for the correct stockroom/bin on row 2 of Sheet2. None of the requirements are met so it evaluates to 0. However, if one of the requirements had been met it would have reported the total for 9900400, even if 9900400 is not in stockroom W or bin 5/W.



        The easiest way to fix this is to make sure all Part #'s are on the same row in both sheets.






        share|improve this answer














        I think the issue is with your range notation.



        The formula is looking for products in stockroom W or a bin beginning with 5 or W on the same row that the formula is entered, regardless of the product number on that row.



        For example, on Sheet1 for product number 9900400 the formula in B2 checks for the correct stockroom/bin on row 2 of Sheet2. None of the requirements are met so it evaluates to 0. However, if one of the requirements had been met it would have reported the total for 9900400, even if 9900400 is not in stockroom W or bin 5/W.



        The easiest way to fix this is to make sure all Part #'s are on the same row in both sheets.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 13 '18 at 17:53

























        answered Dec 13 '18 at 17:06









        Rekamanon

        1011




        1011






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1383334%2fexcel-2016-return-total-quantity-of-matching-part-s-over-multiple-lines-if-con%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Paul Cézanne

            UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

            Angular material date-picker (MatDatepicker) auto completes the date on focus out