c# - Sum columns with a less or equal than criteria and name criteria in Excel -
i have pivottable in excel worksheet1 goes this: rowlabels 'codename' , '#rulenumber'.
rowlabels value codename1 2315(total) 5 5 10 249 25 60 40 0 50 10 60 1991 codename2 (total) 5 xx 10 xx 25 xx 40 xx 50 xx ... xx i have table in worksheet2 needs pull sum of determined set of rules codename. so, if set of rules less or equal 50, following results:
for codename1, 324 , codename2 xx value.
how can this? tried getpivotdata function doesnt work because far know, gets values visible in pivottable.
i can use macros or use language c# solve this.
assuming:
tabular layout pt
repeat item labels checked in field settings
row labels in column e (so codenames in columnf)
valuesis in g
i2:i... contains list of codenames
then in j2 , copied down suit:
=sumproduct((e:e=i2)*(f:f<=50),(g:g))
Comments
Post a Comment