Count most common text value in a specified date range.

WhiteNoiseMaker

New Member
Joined
Jan 23, 2015
Messages
23


My first post and I’m desperately in need of help!


I have a list of dates running from 01/01/2015 to 31/12/2015 in column A. This is followed by the task performed that day, and how much has been processed e.g.


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]05/01/2015[/TD]
[TD]Project 1[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]06/01/2015[/TD]
[TD]Project 1[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD]07/01/2015[/TD]
[TD]Project 1[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]08/01/2015[/TD]
[TD]Project 2[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]09/01/2015[/TD]
[TD]Project 2[/TD]
[TD]60[/TD]
[/TR]
[TR]
[TD]10/01/2015[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11/01/2015[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



I need to be able to count the most common task performed for each week. In the example above the answer I would expect is Project 1, as the majority of the week was spent working on this project.


The example I’ve found below works but I need to specify the date range I want to check, which is too time consuming.


=INDEX(B16:B22,MATCH(MAX(COUNTIF(B16:B22,B16:B22)),COUNTIF(B16:B22,B16:B22),0))


I’m trying to combine the formula above with a formula i have working for counting the totals for each week but I just can’t get it to work.


=SUMIFS($C$16:$C$406,$A$16:$A$406,">="&$O3,$A$16:$A$406,"<="&$O3+6) (O3 contains my list of Monday dates)

Any help would be greatly appreciated :)
 
Try this - use CTRL + SHIFT + ENTER when entering the formula ;)

Code:
=INDEX(B$16:B$406,MODE(IFERROR(IF(A$16:A$406>=O3,IF(A$16:A$406<o3+7,match(b$16:b$406,b$16:b$406,0)*{1,1})),"")))[ code][="" quote]


What is the missing bit off the end of this formula? I tried adding </o3+7,match(b$16:b$406,b$16:b$406,0)*{1,1})),"")))[>[FONT=Lucida Grande]<[/FONT][COLOR=#AB30D6][FONT=Lucida Grande]O3[/FONT][/COLOR][FONT=Lucida Grande]+7,0) but that didn't work.[/FONT]
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Sometimes > or < signs are interpreted as HTML tags and the formula gets cut off at that point, you can leave a space at the open end and it should display correctly, i.e.

=INDEX(B$16:B$406,MODE(IFERROR(IF(A$16:A$406>=O3,IF(A$16:A$406< O3+7,MATCH(B$16:B$406,B$16:B$406,0)*{1,1})),"")))
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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