1

I am attempting to obtain the sum of a column that has duplicate values, and have those duplicate values counted as 1 instance within a specific date range, that is representing the reporting week. So this count should show the count of unique values (kioskID) within that week beginning range.

I have the populate sheet with in E13 I need the count of the kioskID within the date range shown in E9. This count should exclude the duplicate counts.

I have tried countifs, sumifs, frequency and the return value is always 0 when that is not correct. I have tried to pivot the out but I want to avoid using a pivot table reducing manual input to the row in sheet 1.

Example of desired outcome: In week 14 (based on dates in raw data) count unique values from Raw data Column A, but do not count duplicate values.

Sheet 1, populate answer

Raw Data

enter image description here

0

1 Answer 1

0

Here is one way of doing this using SUMPRODUCT() or SUM() with a combination of UNIQUE()+FILTER() :

enter image description here


• Formula used in cell E2

=SUM(--(UNIQUE(FILTER($A$2:$A$25,($C$2:$C$25>=E1)*($C$2:$C$25<=E1+6),0))<>0))

The above formula needs to be filled right, however if you want to spill then using BYCOL()

=BYCOL(E1:L1,LAMBDA(α,SUM(--(UNIQUE(FILTER(A2:A25,(C2:C25>=α)*(C2:C25<=α+6),0))<>0))))

NOTE: You will need to change the cell range and reference as per your suit!


6
  • 1
    I tried the first formula and it was returning counts for a week that is not represented in my data set. the second formula crashed my sheet entirely Commented May 29 at 20:02
  • @PeterDelSol how large is your data. also when you say that the first formula is returning counts for a week that is not represented in your data set, could you show me a screenshot to validate that. Because the formulas seems to be working on my end based on the data given in the OP. Commented May 29 at 20:03
  • 1
    my original dataset is quite large, there are 3 columns of 1965 rows., I have addedd a third screenshot, for weeks 12 and 13, dates 3/23 and 3/30 those are not in my data set so they should be returning 0 Commented May 29 at 20:10
  • Hi @PeterDelSol you are absolutely right, I made a typo, see my updated formula, actually in the last part it should nt be <>"" it should be <>0 please try now, and let me know if you have any questions! Commented May 29 at 20:46
  • 1
    superuser.com/users/1247873/mayukh-bhattacharya this worked! thank you so much! Commented May 29 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .