scaiferw
scaiferw

Reputation: 41

Querying values from a Google Sheets

I have a table of foods with their nutritional values in a Google Sheets. My objective is to enter portions consumed of each food in a given day and calculate nutritional intake for the day. For each row that has a portion entered, I want to summarize the nutritional values times the number of portions served. I've given a very simplified version below.

Can anyone tell me how to go about doing this in Google Sheets?

PORTIONS  FOOD       CALORIES   FAT   PROTEIN
   1      beef       250        34    25
          chicken    220        22    13
          carrots     20        12    23
   2      beans       40        25     5
--------------------------------------------
TOTALS               330        84    35

Upvotes: 1

Views: 131

Answers (1)

Ed Nelson
Ed Nelson

Reputation: 10259

In C6 place:

=sumproduct($A2:$A5,C2:C5)

Then copy across to D6 and E6

Upvotes: 1

Related Questions