produksi ktg
produksi ktg

Reputation: 23

How to sum with weeknum condition in google sheets

i have data and want to sum it with weeknum in every name condition, but i can't do that it always error parse or empty value. this my query

=query(A1:D8,"select sum(D) where D='"&G2&"' and B='"&H1&"' label sum(D)'' ")

=query(A1:D8,"select sum(D) where D='"&G2&"' and weeknum(A)=weeknum('"&H1&"') label sum(D)'' ")

enter image description here

this my link https://docs.google.com/spreadsheets/d/1AHnu-IrFQuh7scbtoQriB_7frhvLUYfO9gIX2yqiXBY/edit?usp=sharing

Upvotes: 0

Views: 114

Answers (1)

player0
player0

Reputation: 1

use:

=QUERY(A:D, "select C,sum(D) where B = "&H1&" group by C label sum(D)''", 0)

enter image description here

if you want 0 values use:

=ARRAYFORMULA({UNIQUE(FILTER(C2:C, C2:C<>"")), 
 IFNA(VLOOKUP(UNIQUE(FILTER(C2:C, C2:C<>"")), 
 QUERY(A:D, "select C,sum(D) where B = "&H1&" group by C label sum(D)''", 0), 2, 0), 0)})

enter image description here

Upvotes: 1

Related Questions