Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
454 views
in Technique[技术] by (71.8m points)

google-sheets - 特定产品的日期范围内的总和值(sum value from a date range for a specific product)

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

(如下所示:我在第2行的每个单元格中都设置了一个日期,如下所示,并且在A列中有我的类别)

[显示1]

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.

(现在,我想从(下图)此工作表中选择总值(即单位成本),该工作表的日期等于1-dec(日期),类别等于office。)

[显示2]

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.

(我尝试使用此公式( =sum(query(DataSheet!A3:J10, "select a,c,i where a= '"&C2&"' and c= '"&A4&"'",0),0) ) -但是它向我显示了一个值错误。)

please help me to solve this issue.

(请帮助我解决此问题。)

  ask by adnan translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

尝试:

=SUM(IFERROR(QUERY(DataSheet!A3:J10, "select I where A = "&C2&" and C = '"&A4&"'" , 0)))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...