countif returns 2 for number in range

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,073
Office Version
  1. 365
Platform
  1. Windows
then when doing a find over that range, there is only one of that number. how does that happen and how do i avoid it happening?
 
Please post an example of where this situation happens using XL2BB
 
Upvote 0
i can't provide the full data set but here is a sample of what's happening. you will see 03810 appears twice and 03237 says its there twice but is only there once.


FY24 Spend - Banded Top100,200.100, Supply Nation.xlsx
HIJ
119$470,324100304
120$461,195100865
121$449,147100478
122$446,711103719
123$440,529203237
124$433,135100756
125$409,933103704
126$408,109100239
127$405,188100345
128$403,269102704
129$265,243203810
130$131,392203810
131$385,516100710
132$384,969103029
133$380,805103457
Supplier Banding (3)
Cell Formulas
RangeFormula
I119:I133I119=COUNTIF($J$6:$J$844,J119)
J119:J133J119=XLOOKUP(F119,'C:\Documents\Spend Categorisation\[FY24 Categorised Spend.xlsb]RAW'!$K$2:$K$28868,'C:\Documents\Spend Categorisation\[FY24 Categorised Spend.xlsb]RAW'!$J$2:$J$28868)
 
Upvote 0
03237 says its there twice but is only there once.
As per what Peter states, how can we tell that the data is only there once when your formula goes from $J$6 to $J$844 and you only show us 119:133, we need representative data where we can see the issue occurring?
Are there hidden or filtered rows on your actual data and you only want to countif the visible rows?
 
Upvote 0
03237 says its there twice but is only there once.
Put this formula in a vacant cell. It should tell you where the two values are.
Excel Formula:
=TEXTJOIN(", ",,"J"&FILTER(ROW(J6:J844),J6:J844=J123))
 
Upvote 0
I manually overwrote the issue at the time but will go back to it and try the textjoin formula Peter. Thanks.

Mark, there were no filtered rows above the section I pasted in. I'll have a crack at Peter's formula above to identify where the second value is (if at all). if that gives me no joy, I'll post the whole thing, rather than just those rows above.. Cheers
 
Upvote 0
If Peter's TextJoinFilter only returns 1 value then try filtering column J by typing into the filter search box.
CountIf would count both the text value 03237 and the numeric value 3237 while the filter function will only bring back the exact match.
 
Upvote 0

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