Countifs with offset returning #value

Simba75

New Member
Joined
Jan 22, 2012
Messages
10
Hoping somebody can help out...please :)

I have a sheet that I want to do countifs on but when I put 2 working countifs together in one formula I get #value?

1. =COUNTIFS(Colleagues!$E:$E,$B$4) - returns the correct result
2. =COUNTIFS(OFFSET(Colleagues!$A$3,1,MATCH($B$2-1,Colleagues!$3:$3,0),20000,1),"*"&$C$2&"*") - returns the correct result

Join them together to get the result I want:
3. =COUNTIFS(Colleagues!$E:$E,$B$4,OFFSET(Colleagues!$A$3,1,MATCH($B$2-1,Colleagues!$3:$3,0),20000,1),"*"&$C$2&"*") - just get #value as result?

Can anybody suggest where I am going wrong as this is melting my brain.

Thanks in advance for advice :)
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Your count ranges are not the same size. With both the same it should work, if not then that would mean no match found.
Excel Formula:
=COUNTIFS(Colleagues!$E$4:$E$20003,$B$4,OFFSET(Colleagues!$A$3,1,MATCH($B$2-1,Colleagues!$3:$3,0),20000,1),"*"&$C$2&"*")
 
Upvote 0
Solution
Jason, you are a star! Thank you so much. This formula works:-
=COUNTIFS(OFFSET(Colleagues!$A$3,1,4,20000,1),$B$4,OFFSET(Colleagues!$A$3,1,MATCH($B$2-1,Colleagues!$3:$3,0),20000,1),"*"&$C$2&"*")

For my education, it seems a bit unnecessary calculation-wise for the first offset when I know the range, is there a way to get around this in a more CPU resource way?

Thanks again for your guidance, its much appreciated! :)
 
Upvote 0
it seems a bit unnecessary calculation-wise for the first offset when I know the range, is there a way to get around this in a more CPU resource way?
How about the way that I re-wrote your formula in my first reply?

Which version of excel are you using? With an up to date version there are better ways to do the same.
 
Upvote 0
Oh yeah, I thought you had just snipped the formula that I had posted and by some black magic it was returning a range.... but I now see that you worked it out and amended it.

Your re-write suggestion also works perfectly. Kudos to you, you have solved in minutes what has been puzzling me for hours.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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