COUNTIF Miscalculating Upon Sort

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I have 2 sheets in the same book that I'm working with. Im trying to count the number of iterations on the Response Details sheet where the value in column G = "NI" and the value in column C matches the value in column E on the Summaries sheet. Column C on the summaries sheet will only have 1 iteration of different values (let's say apple), while column C on the Response Details sheet will have multiple iterations of apple. I've been using this formula, which works until I sort either sheet.

=COUNTIFS('RESPONSE DETAILS'!$C:$C,SUMMARIES!$E133,'RESPONSE DETAILS'!$G:$G,"NI")

I feel as though I need to somehow combine the COUNTIFS with a VLOOKUP, but I'm unsure.

I apologize for any issues with the formatting of this post. For some reason, my work laptop only allows me to enter a thread title, but nothing in the body of a thread, so I had to type this on my mobile.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Assuming the formula is on the summaries sheet use
Excel Formula:
=COUNTIFS('RESPONSE DETAILS'!$C:$C,$E133,'RESPONSE DETAILS'!$G:$G,"NI")
You should never refer to the sheet name the formula is in.
 
Upvote 0
Solution
and the value in column C matches the value in column E on the Summaries sheet.
What value are you trying to match
the formula you have used is looking at a criterial in E133
whats special about that Row 133 , and what are you sorting?
it will change value when sorting
And change Cell reference when copying
 
Upvote 0
Assuming the formula is on the summaries sheet use
Excel Formula:
=COUNTIFS('RESPONSE DETAILS'!$C:$C,$E133,'RESPONSE DETAILS'!$G:$G,"NI")
You should never refer to the sheet name the formula is in.
@Fluff thanks as always! As far as the reference to the sheet the formula is in, excel automatically enters that, so I guess I'll just need to start deleting those references.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,817
Messages
6,121,717
Members
449,050
Latest member
MiguekHeka

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