COUNTIFS not counting (not a TRIM issue)

EvonS

Board Regular
Joined
Jun 1, 2016
Messages
111
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello Everyone,

I'm using a COUNTIF function to count the number of times a particular organization name appears

Code:
=COUNTIF(INDIRECT("'Data Fields'!$E$"&$B$2&":$E$"&$C$2),E60)

This formula counts correctly and calls the organization name from a list on a different sheet.
The output from this formula (in combination with other formulas) looks like this


OriginatingLeadAssisting
Toronto Police Service - 51 Division18281%146%768%

<tbody>
</tbody>

However, another section of the same sheet counts the number of times an organization name appears per month. I use the following code to accomplish this:

Code:
=COUNTIFS(INDIRECT("'Data Fields'!$e$"&$B$2&":$e$"&$C$2), "="&$Q$42, INDIRECT("'Data Fields'!$b$"&$B$2&":$b$"&$C$2), ">="&DATE(2018, 1, 1),INDIRECT("'Data Fields'!$b$"&$B$2&":$b$"&$C$2), "<="&DATE(2018,1,31))

The chart looks like this:



Agency Activity By Month
Toronto Police Service - 51 Division
MonthOriginatingLeadAssisting
January1631
February1810
March2130
April1810
May2522
June1231
July1903
August1711
September1602
October1901
November000
December000
TOTALS1811411

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

The totals should be equal to the ones in the first chart but they are not. Both formulas call the agency name from the same agency list so I know it's not a TRIM solution. I used the "Find & Select" tool to confirm that that the numbers in the first table are indeed correct. Does anyone have any ideas?

Thanks in advance for the help.

Regards,


Evon
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Thank you for taking the time to reply. B2 and C2 represent the cell ranges. They allow me to easily define custom ranges for the function to count. The E column represents "originating". There are different formulas for each column where I change the column reference depending on what I want to count. The formula included in my post is the foundation for the other formulas.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,684
Members
449,116
Latest member
HypnoFant

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