Using VLOOKUP for multiple lookup values, then summing the outputs












2















Example:



I have a sheet listing the number of calories for various foods.



Calorie Data



In another sheet I have a list of some of those foods to be used in a meal, and would like to calculate the total number of calories for that particular meal.



Meal



How can I lookup the calorie data for each food item in the meal, and then sum each of those values together?



I thought something like =SUM(VLOOKUP(A2:A4,$Sheet1.A2:B13,2,0)) might work but alas not.










share|improve this question




















  • 3





    Do an individual VLOOKUP for each cell in the meal table, then use sum for the total.

    – fixer1234
    Jan 29 at 0:11











  • Try to use SUMPRODUCT function.

    – Lee
    Jan 29 at 8:56











  • Great tip while using excel. Never use vlookup, always use index-match. Much more reliable and versatile.

    – Michthan
    Jan 29 at 14:38
















2















Example:



I have a sheet listing the number of calories for various foods.



Calorie Data



In another sheet I have a list of some of those foods to be used in a meal, and would like to calculate the total number of calories for that particular meal.



Meal



How can I lookup the calorie data for each food item in the meal, and then sum each of those values together?



I thought something like =SUM(VLOOKUP(A2:A4,$Sheet1.A2:B13,2,0)) might work but alas not.










share|improve this question




















  • 3





    Do an individual VLOOKUP for each cell in the meal table, then use sum for the total.

    – fixer1234
    Jan 29 at 0:11











  • Try to use SUMPRODUCT function.

    – Lee
    Jan 29 at 8:56











  • Great tip while using excel. Never use vlookup, always use index-match. Much more reliable and versatile.

    – Michthan
    Jan 29 at 14:38














2












2








2


1






Example:



I have a sheet listing the number of calories for various foods.



Calorie Data



In another sheet I have a list of some of those foods to be used in a meal, and would like to calculate the total number of calories for that particular meal.



Meal



How can I lookup the calorie data for each food item in the meal, and then sum each of those values together?



I thought something like =SUM(VLOOKUP(A2:A4,$Sheet1.A2:B13,2,0)) might work but alas not.










share|improve this question
















Example:



I have a sheet listing the number of calories for various foods.



Calorie Data



In another sheet I have a list of some of those foods to be used in a meal, and would like to calculate the total number of calories for that particular meal.



Meal



How can I lookup the calorie data for each food item in the meal, and then sum each of those values together?



I thought something like =SUM(VLOOKUP(A2:A4,$Sheet1.A2:B13,2,0)) might work but alas not.







microsoft-excel worksheet-function libreoffice-calc spreadsheet vlookup






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 29 at 4:00









xypha

1,68111330




1,68111330










asked Jan 29 at 0:00









user991200user991200

111




111








  • 3





    Do an individual VLOOKUP for each cell in the meal table, then use sum for the total.

    – fixer1234
    Jan 29 at 0:11











  • Try to use SUMPRODUCT function.

    – Lee
    Jan 29 at 8:56











  • Great tip while using excel. Never use vlookup, always use index-match. Much more reliable and versatile.

    – Michthan
    Jan 29 at 14:38














  • 3





    Do an individual VLOOKUP for each cell in the meal table, then use sum for the total.

    – fixer1234
    Jan 29 at 0:11











  • Try to use SUMPRODUCT function.

    – Lee
    Jan 29 at 8:56











  • Great tip while using excel. Never use vlookup, always use index-match. Much more reliable and versatile.

    – Michthan
    Jan 29 at 14:38








3




3





Do an individual VLOOKUP for each cell in the meal table, then use sum for the total.

– fixer1234
Jan 29 at 0:11





Do an individual VLOOKUP for each cell in the meal table, then use sum for the total.

– fixer1234
Jan 29 at 0:11













Try to use SUMPRODUCT function.

– Lee
Jan 29 at 8:56





Try to use SUMPRODUCT function.

– Lee
Jan 29 at 8:56













Great tip while using excel. Never use vlookup, always use index-match. Much more reliable and versatile.

– Michthan
Jan 29 at 14:38





Great tip while using excel. Never use vlookup, always use index-match. Much more reliable and versatile.

– Michthan
Jan 29 at 14:38










2 Answers
2






active

oldest

votes


















4














Sum a SUMIFS:



=SUMPRODUCT(SUMIFS(Sheet1!B:B,Sheet1!A:A,A2:A5))


This will iterate the various parts of the meal in A2:A5 and sum the outputs of the SUMIFS.






share|improve this answer































    2














    Use the B column to grab your calorie count with vlookup, then sum those at the bottom of the column.



    B cells next to meal consumed:



    =vlookup(A2,$Sheet1!A:B,2,0)


    Then a simple sum of the column:



    =sum(B2:B5)



    Your function above may work as an array function by using cntrl-shift-enter to finalize it and changing your period to an exclamation mark. (untested)






    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%2f1399462%2fusing-vlookup-for-multiple-lookup-values-then-summing-the-outputs%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









      4














      Sum a SUMIFS:



      =SUMPRODUCT(SUMIFS(Sheet1!B:B,Sheet1!A:A,A2:A5))


      This will iterate the various parts of the meal in A2:A5 and sum the outputs of the SUMIFS.






      share|improve this answer




























        4














        Sum a SUMIFS:



        =SUMPRODUCT(SUMIFS(Sheet1!B:B,Sheet1!A:A,A2:A5))


        This will iterate the various parts of the meal in A2:A5 and sum the outputs of the SUMIFS.






        share|improve this answer


























          4












          4








          4







          Sum a SUMIFS:



          =SUMPRODUCT(SUMIFS(Sheet1!B:B,Sheet1!A:A,A2:A5))


          This will iterate the various parts of the meal in A2:A5 and sum the outputs of the SUMIFS.






          share|improve this answer













          Sum a SUMIFS:



          =SUMPRODUCT(SUMIFS(Sheet1!B:B,Sheet1!A:A,A2:A5))


          This will iterate the various parts of the meal in A2:A5 and sum the outputs of the SUMIFS.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 29 at 14:22









          Scott CranerScott Craner

          12.4k11318




          12.4k11318

























              2














              Use the B column to grab your calorie count with vlookup, then sum those at the bottom of the column.



              B cells next to meal consumed:



              =vlookup(A2,$Sheet1!A:B,2,0)


              Then a simple sum of the column:



              =sum(B2:B5)



              Your function above may work as an array function by using cntrl-shift-enter to finalize it and changing your period to an exclamation mark. (untested)






              share|improve this answer




























                2














                Use the B column to grab your calorie count with vlookup, then sum those at the bottom of the column.



                B cells next to meal consumed:



                =vlookup(A2,$Sheet1!A:B,2,0)


                Then a simple sum of the column:



                =sum(B2:B5)



                Your function above may work as an array function by using cntrl-shift-enter to finalize it and changing your period to an exclamation mark. (untested)






                share|improve this answer


























                  2












                  2








                  2







                  Use the B column to grab your calorie count with vlookup, then sum those at the bottom of the column.



                  B cells next to meal consumed:



                  =vlookup(A2,$Sheet1!A:B,2,0)


                  Then a simple sum of the column:



                  =sum(B2:B5)



                  Your function above may work as an array function by using cntrl-shift-enter to finalize it and changing your period to an exclamation mark. (untested)






                  share|improve this answer













                  Use the B column to grab your calorie count with vlookup, then sum those at the bottom of the column.



                  B cells next to meal consumed:



                  =vlookup(A2,$Sheet1!A:B,2,0)


                  Then a simple sum of the column:



                  =sum(B2:B5)



                  Your function above may work as an array function by using cntrl-shift-enter to finalize it and changing your period to an exclamation mark. (untested)







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 29 at 0:16









                  BrianBrian

                  5487




                  5487






























                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1399462%2fusing-vlookup-for-multiple-lookup-values-then-summing-the-outputs%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

                      Plaza Victoria

                      In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                      How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...