COUNTIFS and SUMPRODUCT yield different answers from same data source

WildWill

Board Regular
Joined
Sep 10, 2009
Messages
92
Hi

I have a dataset that contains a wide range of HR-related information (could not post it here using Excel Jeanie due to size). From this same data set, two different formulae are giving two different answers, and this is driving me nuts. I have looked at all the possible causes in terms of data integrity etc. and I just cant understand why these would yield different answers. Please help.

The items being measured in both cases are totals of Rig-Based Employees (a) and Totals of Non-Rig Employees (b). If I use the SUMPRODUCT formulae below for respectively (a) and (b) , I get (a) = 165 and (b) = 25:

formula for a: =SUMPRODUCT((Source!$D$4:$D$203=SUMPRODUCT!A2)*(Source!$G$4:$G$203<>"Leaver")*(Source!$G$4:$G$203<>"Transfer Out"))
formula for b: =SUMPRODUCT((Source!$D$4:$D$203=SUMPRODUCT!A3)*(Source!$G$4:$G$203<>"Leaver")*(Source!$G$4:$G$203<>"Transfer Out"))

Now, with the same dataset, a different approach using a COUNTIFS formula (below) yields (a) = 166 and (b) = 24:

(Again, this is complicated to show without being able to attach the worksheet, but the below formula is repeated in a table for all the different permutations of data)

=SUM(COUNTIFS(Source!$C$4:$C$203,COUNTIFS!C4,Source!$B$4:$B$203,"Non-Local",Source!$F$4:$F$203,{"Expat","TCN"},Source!$G$4:$G$203,{"Starter";"Transfer In";""}))
Is there any other way that I can share the sheets here? sure that will simplify what I am trying to show.

Will
 
Hello!
Your formula works fine
 
Last edited:
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thanks Jonmo1 and GerryZ for all your help! I am going to add some more error checking features to the base data sheet so that those types of mistakes are identified upfront.
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

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