counting single entries where duplicates appear within a specific date range

xxrichbxx

New Member
Joined
Sep 2, 2015
Messages
49
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a count which will essentially only count a single entry from a range where there could be multiples.

I was looking at a combination of countifs and frequency, but was struggling to get my head around it.

I think that an example of my source data and what I expect to see would give a better understanding of the problem

Week Number Cell ID Date
29 12345 13/07/2020
29 98765 14/07/2020
29 12345 17/07/2020
30 12345 20/07/2020
30 12345 21/07/2020
30 98765 21/07/2020
30 11111 22/07/2020

Summary

Week 29 2
Week 30 3

Hopefully that makes sense.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I have a follow on from the question raised. Previously I was look at week numbers, so example week 29 is the date range of 20/07/2020 to 26/07/2020.

The previous function was =IFERROR(ROWS(UNIQUE(FILTER('Master Tracker'!$C$2:$C$486,'Master Tracker'!$A$2:$A$486=$A3))),"") with a3 being the week number. What I need to do is rather than showing A3 as week 29 I am wanting to show it as a range.

A simple countifs would work, but then I have the added complexity of having an ID appearing multiple times.
 
Upvote 0
If you mean you want to replace the week numbers with something like
20/07/2020 - 26/07/2020
Then my advice would be don't, a cell should only hold one piece of data, not ranges.
 
Upvote 0
agree completely with you, a range within a cell...massive no no.

I am trying to create something like the below
TA PACS Faults Week ending 22.07.2020 new.xlsx
ABCDEFGHI
1Cell IDDate CreatedMonthDate RangeSitesInstancesAvg. instances
21375909-Jul-20June01-Jun30-Jun471.8
31375909-Jul-20July01-Jul31-Jul362.0
41174610-Jun-20
51174613-Jun-20
61371102-Jun-20
71371102-Jun-20
81174610-Jun-20
91174610-Jun-20
101174611-Jul-20
111174611-Jul-20
121377620-Jun-20
131377620-Jul-20
141377621-Jul-20
15
Raw data


As you will see columns E&F are the date range. I am trying to glean the data from A&B.

Hopefully this makes sense.
 
Upvote 0
Ok in G2
=ROWS(UNIQUE(FILTER($A$2:$A$14,($B$2:$B$14>=$E2)*($B$2:$B$14<=$F2))))
in H2
=ROWS(FILTER($A$2:$A$14,($B$2:$B$14>=$E2)*($B$2:$B$14<=$F2)))
 
Upvote 0
I can't seem to get that to work with my data. Could it be because I have dates prior to the range?
 
Upvote 0
That shouldn't make a difference, in what way isn't it working?
 
Upvote 0
it doesn't appear to be returning the correct results.

I have used it on a much larger sheet replicating what both you and I have added.

The number of sites added is showing 319, but the correct result is 62.

I have increase the data range to include whole column or a specific field set, but it returns the same result.
 
Upvote 0
Are you sure that all your dates are real dates & not text?
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top