Activity/Day count

aylar

New Member
Joined
Jun 3, 2015
Messages
7
​Hi,

I'm not sure where to start with this right now, a little in over my head. I'm trying to create a formula that counts the number of days a month an activity is performed (A) by certain users (B) based off of the transactions (C). The transacation dates also need to be redefined, as the shifts occur overnight. This is what a sample of the data looks like:

UserActivityTransaction timeFormula output - # of Activity days per period
A111/28/2015 7:11
1
B111/29/2015 8:11
1
C111/29/2015 9:11
1
C211/29/2015 10:11
1
A111/29/2015 11:11
2
C211/29/2015 12:11
1
A311/30/2015 9:00
1
B211/30/2015 10:01
1
A211/30/2015 10:30
1
C311/30/2015 11:30
1
D111/30/2015 12:30
1
A112/1/2015 8:11
3
B212/1/2015 9:03
2
B212/1/2015 10:11
2

Any help would be appreciated
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Since this hasn't had an answer yet, let's see if we can't get things started. I thought I understood your goal, but the example table doesn't fit with what I thought. Should the entry on 11/29/2015 12:11 have a result of 2 instead of 1 (as shown)?

I tried the following setup; note the formula in D2 is copied down the column:

Excel 2010
ABCD
1UserActivityTransaction timeFormula output - # of Activity days per period
2A111/28/2015 7:111
3B111/29/2015 8:111
4C111/29/2015 9:111
5C211/29/2015 10:111
6A111/29/2015 11:112
7C211/29/2015 12:112
8A311/30/2015 9:001
9B211/30/2015 10:011
10A211/30/2015 10:301
11C311/30/2015 11:301
12D111/30/2015 12:301
13A112/1/2015 8:113
14B212/1/2015 9:032
15B212/1/2015 10:113
Sheet1
Cell Formulas
RangeFormula
D2=COUNTIFS(A$1:A1,A2,B$1:B1,B2)+1

Do the counts need to reset when the transaction time enters a new month?
 
Last edited:
Upvote 0
I think if you want the count to reset for a new month, D2 should be: =COUNTIFS(A$1:A1,A2,B$1:B1,B2,C$1:C1,">="&(MONTH(C2)&"/1/"&YEAR(C2)),C$1:C1,"<="&EOMONTH(C2,0))+1
and copy down.

This may not work correctly- let me know if it doesn't.
 
Last edited:
Upvote 0
Thanks Elmer,

There wasn't a mistake in the data set. If the activity is performed multiple times on the same day, I would like it to only be counted once. I'm not sure what the logic would look like for that exception, but thanks for steering me in the right direction.
 
Upvote 0
Bump -

I haven't been able to solve this problem still. I don't know why this didn't work. I made a helper column in E that rounded all the transaction times down to midnight of that day, and then changed the formula to
=COUNTIFS(A$1:A1,A2,B$1:B1,B2,E$1:E1,E2)+1

Again, activities counted on the same day to not be counted.
Any help appreciated,
Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,857
Messages
6,127,374
Members
449,382
Latest member
DonnaRisso

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