Counting Data Based on Multiple Criteria

Redlad91

New Member
Joined
Sep 29, 2015
Messages
11
Office Version
  1. 365
Hi,

I was wondering if i could get some help on a formula that i am looking to get up and running, I have tried Countifs and Index but seem to be having no luck in getting a result back, MY dilemma is based on two sheets, The first being just raw CSV data (this is what i want the formula to look at) and the output table (This is where i want it to show the number of results found).

What i am trying to find is an overall count of how many incidents which were assigned to a certain person on a certain day, using the two tables below;

Data table
ABC
1IncidentName Date Opened
2INC0001Ben 26/06/2019
3INC0002Bradley 25/06/2019
4INC0003Tom26/06/2019
5INC0004Ben26/06/2019

<tbody>
</tbody>

Output Table
ABCD
1DateBenBradleyTom
225/06/2019010
326/06/2019201

<tbody>
</tbody>

MY formula i previously used but TNA was:

=Countifs('Data Table'!B:B,'Output Table'!B1, 'Data Table'!C:C, 'Output Table'!A2)

Let me know if anyone has any questions, Will be happy to help.

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You always want to compare against Row in the output table - ALWAYS - so you need to anchor the reference when comparing against the names
Same with dates

Try (this assumes you have header names in row 1 and dates in column 1

=Countifs('Data Table'!B$:B$100000,'Output Table'!B$1, 'Data Table'!C$2:C$100000, 'Output Table'!$A2)

It's not econimcal to use whole ranges, e.g. A:A or B:B, put a row number in that will cover the complete range of data, e.g. A1:A100000
 
Last edited:
Upvote 0
Hi, THanks for the reply, I tried previously with the anchors but still coming back with 0 even though i know there are results which should be counted. I tried the formula you posted above but still TNA.

Could this be if the date on the left of the table has a formula within the output table? So i have set it up so there is always todays date at the top, and down the left automatically updates and add's a date dependant on this first cell, for example below;

Output Table
A
BCD
1Todays date26/06/2019
2
3DateBenBradleyTom
4A5-1 (25/06/2019)010
5=B1 (26/06/2019)201

<tbody>
</tbody>

Other than that i am not sure what else could be causing the formula not to work, Potentially that my data is CSV? would it be better as normal data, or could it be something to do with the formatting of the cells?

Thanks
 
Upvote 0
Isolate the problem, take out one of the conditions and see what values you get. You'll have to manually count and compare results but it will give you an idea of whether the date comparison is failing or the name comparison.

Failing that, upload the file to an online storage site and post a link here though moderators prefer people don't do that.
Without examining the data it's gonna be difficult to solve.
 
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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