Google Sheets - get the value corresponding to maximum element in another column where the value is non-empty












0















I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.



A               C
2019-01-22
2019-01-15
2019-01-08 200
2019-01-01 191.4


So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.










share|improve this question





























    0















    I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.



    A               C
    2019-01-22
    2019-01-15
    2019-01-08 200
    2019-01-01 191.4


    So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.










    share|improve this question



























      0












      0








      0








      I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.



      A               C
      2019-01-22
      2019-01-15
      2019-01-08 200
      2019-01-01 191.4


      So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.










      share|improve this question
















      I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.



      A               C
      2019-01-22
      2019-01-15
      2019-01-08 200
      2019-01-01 191.4


      So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.







      google-sheets






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 1 at 23:34









      Dandelion

      409721




      409721










      asked Jan 1 at 19:10









      Micah PearceMicah Pearce

      462413




      462413
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:



          INDIRECT(
          ADDRESS(
          MATCH(
          MAX(
          FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
          )
          ,A2:A5)
          ,2)
          )


          Note that the ending 2 is the column number of "B".






          share|improve this answer

































            1














            Please try, for weight:



            =index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))


            or for date (the 'engine' for above):



            =maxifs(A:A,C:C,"<>")


            Or, a little shorter:



            =VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)


            Shorter still, if the sort order can be guaranteed:



            =index(filter(C:C,C:C>0),1,1)





            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%2f53998202%2fgoogle-sheets-get-the-value-corresponding-to-maximum-element-in-another-column%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:



              INDIRECT(
              ADDRESS(
              MATCH(
              MAX(
              FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
              )
              ,A2:A5)
              ,2)
              )


              Note that the ending 2 is the column number of "B".






              share|improve this answer






























                1














                Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:



                INDIRECT(
                ADDRESS(
                MATCH(
                MAX(
                FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
                )
                ,A2:A5)
                ,2)
                )


                Note that the ending 2 is the column number of "B".






                share|improve this answer




























                  1












                  1








                  1







                  Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:



                  INDIRECT(
                  ADDRESS(
                  MATCH(
                  MAX(
                  FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
                  )
                  ,A2:A5)
                  ,2)
                  )


                  Note that the ending 2 is the column number of "B".






                  share|improve this answer















                  Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:



                  INDIRECT(
                  ADDRESS(
                  MATCH(
                  MAX(
                  FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
                  )
                  ,A2:A5)
                  ,2)
                  )


                  Note that the ending 2 is the column number of "B".







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 1 at 20:10

























                  answered Jan 1 at 19:56









                  DandelionDandelion

                  409721




                  409721

























                      1














                      Please try, for weight:



                      =index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))


                      or for date (the 'engine' for above):



                      =maxifs(A:A,C:C,"<>")


                      Or, a little shorter:



                      =VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)


                      Shorter still, if the sort order can be guaranteed:



                      =index(filter(C:C,C:C>0),1,1)





                      share|improve this answer






























                        1














                        Please try, for weight:



                        =index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))


                        or for date (the 'engine' for above):



                        =maxifs(A:A,C:C,"<>")


                        Or, a little shorter:



                        =VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)


                        Shorter still, if the sort order can be guaranteed:



                        =index(filter(C:C,C:C>0),1,1)





                        share|improve this answer




























                          1












                          1








                          1







                          Please try, for weight:



                          =index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))


                          or for date (the 'engine' for above):



                          =maxifs(A:A,C:C,"<>")


                          Or, a little shorter:



                          =VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)


                          Shorter still, if the sort order can be guaranteed:



                          =index(filter(C:C,C:C>0),1,1)





                          share|improve this answer















                          Please try, for weight:



                          =index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))


                          or for date (the 'engine' for above):



                          =maxifs(A:A,C:C,"<>")


                          Or, a little shorter:



                          =VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)


                          Shorter still, if the sort order can be guaranteed:



                          =index(filter(C:C,C:C>0),1,1)






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jan 1 at 21:43

























                          answered Jan 1 at 20:33









                          pnutspnuts

                          48.9k763100




                          48.9k763100






























                              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%2f53998202%2fgoogle-sheets-get-the-value-corresponding-to-maximum-element-in-another-column%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