sum value from a date range for a specific product

丶灬走出姿态 提交于 2019-12-20 06:41:03

问题


I am looking to sum up multiple values from multiple cells where they will match a date and a product.

like below: I have a date set in every cell in row 2 as below, and I have my categories in column A

now I want to pick the total value (that is unit costs) from (below picture) this sheet where the date is equal to 1-dec (date) and the category is equal to office.

I tried using this formula ( =sum(query(DataSheet!A3:J10, "select a,c,i where a= '"&C2&"' and c= '"&A4&"'",0),0) ) - but it is showing me a value error.

please help me to solve this issue.


回答1:


first you will need to fix those dates:

try:

then:

=SUM(IFERROR(QUERY(DataSheet!$A3:$J4, 
 "select J 
  where C = '"&$A4&"' 
    and A = date '"&TEXT(C$2, "yyyy-mm-dd")&"'", 0)))



来源:https://stackoverflow.com/questions/59123313/sum-value-from-a-date-range-for-a-specific-product

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!