[英]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.