Returning Values Based on Matching Criteria of Multiple Cells in Multiple Rows plus Rank from another Table...












-1















How do I return different values (Y or N) to different cells (ColD - Master) based upon matching criteria (ColA - Date and ColB - Customer) and sort orders (MasterItemRanking tab ColA) in Google Sheets?



https://docs.google.com/spreadsheets/d/1Yar31N__3jkHH3y6qn_XZ0cvkEg-gG0ALeT0FF8qEQE/edit?usp=sharing



On Sheet "MasterItemRanking" ColA, the lower the value in ColA, the higher the ranking. Ranking of a #1 is superior to a ranking of a #2 or #5, etc (which means ColB item should be returned as "Y" before any of the others).



I have tried various expressions in ColD and have failed miserably so far. Thoughts? Thanks.










share|improve this question



























    -1















    How do I return different values (Y or N) to different cells (ColD - Master) based upon matching criteria (ColA - Date and ColB - Customer) and sort orders (MasterItemRanking tab ColA) in Google Sheets?



    https://docs.google.com/spreadsheets/d/1Yar31N__3jkHH3y6qn_XZ0cvkEg-gG0ALeT0FF8qEQE/edit?usp=sharing



    On Sheet "MasterItemRanking" ColA, the lower the value in ColA, the higher the ranking. Ranking of a #1 is superior to a ranking of a #2 or #5, etc (which means ColB item should be returned as "Y" before any of the others).



    I have tried various expressions in ColD and have failed miserably so far. Thoughts? Thanks.










    share|improve this question

























      -1












      -1








      -1








      How do I return different values (Y or N) to different cells (ColD - Master) based upon matching criteria (ColA - Date and ColB - Customer) and sort orders (MasterItemRanking tab ColA) in Google Sheets?



      https://docs.google.com/spreadsheets/d/1Yar31N__3jkHH3y6qn_XZ0cvkEg-gG0ALeT0FF8qEQE/edit?usp=sharing



      On Sheet "MasterItemRanking" ColA, the lower the value in ColA, the higher the ranking. Ranking of a #1 is superior to a ranking of a #2 or #5, etc (which means ColB item should be returned as "Y" before any of the others).



      I have tried various expressions in ColD and have failed miserably so far. Thoughts? Thanks.










      share|improve this question














      How do I return different values (Y or N) to different cells (ColD - Master) based upon matching criteria (ColA - Date and ColB - Customer) and sort orders (MasterItemRanking tab ColA) in Google Sheets?



      https://docs.google.com/spreadsheets/d/1Yar31N__3jkHH3y6qn_XZ0cvkEg-gG0ALeT0FF8qEQE/edit?usp=sharing



      On Sheet "MasterItemRanking" ColA, the lower the value in ColA, the higher the ranking. Ranking of a #1 is superior to a ranking of a #2 or #5, etc (which means ColB item should be returned as "Y" before any of the others).



      I have tried various expressions in ColD and have failed miserably so far. Thoughts? Thanks.







      sorting filter google-sheets ranking






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 14:48









      Chapel 042Chapel 042

      83




      83
























          1 Answer
          1






          active

          oldest

          votes


















          0














          This is a complicated answer, but it seems like this formula works. =arrayformula(if(A2="",,iferror(if(C2=vlookup(MIN(if(countA(vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))=1,"N",vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))),MasterItemRanking!A:B,2,false),"Y","N"),"N")))



          I put it into your sheet and it seems to make sense, although if there is anything it is missing, let me know. It basically filters the table for just that row's data to see if there are multiple items that have the same date and person. Then it does a vlookup to return for each item its ranking. Then it grabs the min value ranking and checks that value against the item in that row. For example, if it returns ranking one, then it checks that row item to see if it is also ranking #1. It does this for each row. This is a very convoluted answer lol, it is sort of hard to explain this one.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            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%2fstackoverflow.com%2fquestions%2f53996403%2freturning-values-based-on-matching-criteria-of-multiple-cells-in-multiple-rows-p%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














            This is a complicated answer, but it seems like this formula works. =arrayformula(if(A2="",,iferror(if(C2=vlookup(MIN(if(countA(vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))=1,"N",vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))),MasterItemRanking!A:B,2,false),"Y","N"),"N")))



            I put it into your sheet and it seems to make sense, although if there is anything it is missing, let me know. It basically filters the table for just that row's data to see if there are multiple items that have the same date and person. Then it does a vlookup to return for each item its ranking. Then it grabs the min value ranking and checks that value against the item in that row. For example, if it returns ranking one, then it checks that row item to see if it is also ranking #1. It does this for each row. This is a very convoluted answer lol, it is sort of hard to explain this one.






            share|improve this answer




























              0














              This is a complicated answer, but it seems like this formula works. =arrayformula(if(A2="",,iferror(if(C2=vlookup(MIN(if(countA(vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))=1,"N",vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))),MasterItemRanking!A:B,2,false),"Y","N"),"N")))



              I put it into your sheet and it seems to make sense, although if there is anything it is missing, let me know. It basically filters the table for just that row's data to see if there are multiple items that have the same date and person. Then it does a vlookup to return for each item its ranking. Then it grabs the min value ranking and checks that value against the item in that row. For example, if it returns ranking one, then it checks that row item to see if it is also ranking #1. It does this for each row. This is a very convoluted answer lol, it is sort of hard to explain this one.






              share|improve this answer


























                0












                0








                0







                This is a complicated answer, but it seems like this formula works. =arrayformula(if(A2="",,iferror(if(C2=vlookup(MIN(if(countA(vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))=1,"N",vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))),MasterItemRanking!A:B,2,false),"Y","N"),"N")))



                I put it into your sheet and it seems to make sense, although if there is anything it is missing, let me know. It basically filters the table for just that row's data to see if there are multiple items that have the same date and person. Then it does a vlookup to return for each item its ranking. Then it grabs the min value ranking and checks that value against the item in that row. For example, if it returns ranking one, then it checks that row item to see if it is also ranking #1. It does this for each row. This is a very convoluted answer lol, it is sort of hard to explain this one.






                share|improve this answer













                This is a complicated answer, but it seems like this formula works. =arrayformula(if(A2="",,iferror(if(C2=vlookup(MIN(if(countA(vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))=1,"N",vlookup(filter(C$2:C$10,A$2:A$10=A2,B$2:B$10=B2),{MasterItemRanking!B:B,MasterItemRanking!A:A},2,false))),MasterItemRanking!A:B,2,false),"Y","N"),"N")))



                I put it into your sheet and it seems to make sense, although if there is anything it is missing, let me know. It basically filters the table for just that row's data to see if there are multiple items that have the same date and person. Then it does a vlookup to return for each item its ranking. Then it grabs the min value ranking and checks that value against the item in that row. For example, if it returns ranking one, then it checks that row item to see if it is also ranking #1. It does this for each row. This is a very convoluted answer lol, it is sort of hard to explain this one.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 2 at 15:27









                Eliana CohenEliana Cohen

                2397




                2397
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • 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%2fstackoverflow.com%2fquestions%2f53996403%2freturning-values-based-on-matching-criteria-of-multiple-cells-in-multiple-rows-p%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

                    MongoDB - Not Authorized To Execute Command

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

                    Npm cannot find a required file even through it is in the searched directory