简体   繁体   English

Google 表格:如何从下拉菜单中求和总计

[英]Google Sheets: How can I SUM total from drop down menu

I am making a sheet for meal planning and tracking calories.我正在制作一张用于膳食计划和跟踪卡路里的表格。

I have made a separate sheet with the recipe names and their calories.我已经制作了一张单独的表格,上面有食谱名称和它们的卡路里。 In the main meal prep section I have 4 drop downs per day where I can pick the recipe names.在主餐准备部分,我每天有 4 个下拉菜单,我可以在其中选择食谱名称。 I want to take those names, reference the calories and put the sum total at the bottom for each day.我想取这些名字,参考卡路里并将每天的总和放在底部。 I do think SUMIF is the right direction but I can't seem to get it to work.我确实认为 SUMIF 是正确的方向,但我似乎无法让它发挥作用。

https://docs.google.com/spreadsheets/d/1wiFmKy0it96hkUKxL5QcyGYG8xtSl7E2fUEdEF34ajo/edit?usp=sharing https://docs.google.com/spreadsheets/d/1wiFmKy0it96hkUKxL5QcyGYG8xtSl7E2fUEdEF34ajo/edit?usp=sharing

Here is the file so you can see what I am making.这是文件,所以你可以看到我在做什么。 Thank you for taking the time to read this and help.感谢您花时间阅读本文并提供帮助。

Thank you,谢谢,

DemonEarth恶魔地球

try:尝试:

=ARRAYFORMULA(TRANSPOSE(MMULT(TRANSPOSE(
 IFNA(VLOOKUP(B2:H5, Meals!A:B, 2, 0), 0)), 
 SEQUENCE(ROWS(B2:H5), 1, 1, 0))))

在此处输入图像描述

or:或者:

=INDEX(QUERY(IFNA(VLOOKUP(B2:H5, Meals!A:B, 2, 0), 0), 
 "select sum(Col1),sum(Col2),sum(Col3),sum(Col4),sum(Col5),sum(Col6),sum(Col7)"), 2)

在此处输入图像描述

=INDEX(QUERY(IFNA(VLOOKUP(B2:H5, Meals!A:B, 2, ), 0), 
 "select "&TEXTJOIN(",", 1, "sum(Col"&SEQUENCE(COLUMNS(B2:H5))&")", )), 2)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 daterangepicker 日期放入下拉菜单? - How can I make daterangepicker dates into a drop down menu? 如何从 Google 表格中的范围动态构建数组? - How can I dynamically build an array from ranges in Google Sheets? 从 Google 表格中的项目列中创建字段中项目的下拉列表 - Make a drop-down list of items in a field from a column of items in Google Sheets 如何在谷歌表格中的复选框之间求和? - How do I sum between check boxes in google sheets? 通过JavaScript从下拉菜单中选择一个值[Google帐户创建页面] - Selecting a value from a drop down menu via Javascript [Google accounts creation page] 如何计算嵌套 object 中的属性总数? - How can I sum total amount of properties in a nested object? 如何在下拉列表中使用Json数组值? - How can i use Json array value in drop down list? 如何使用 Google 表格中查询 function 的 select 语句从单元格中获取文本? - How can I get text from a cell using the select statement of the query function in Google Sheets? 如何在 Apps 脚本(Google 表格)中过滤从 UrlFetchApp 检索到的数据 - How can I filter the data retrieved from UrlFetchApp in Apps Script (Google sheets) 在 Javascript 中,如何从下拉列表和表格中汇总数组中的所有值? - In Javascript, How to sum up all the values in an array from a drop down list and form?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM