Why COUNTIF() returns zero in excel?

Noni

Board Regular
Joined
Aug 27, 2022
Messages
63
Office Version
  1. 2021
Platform
  1. Windows
I've two columns of addresses (2022 customer address, and 2023 customer address) on the same sheet. I want to check if a 2023 address in column D is of an existing or new customer (comparing it with column C). I also aim to find out if the 2022 customer is no longer a customer in 2023.

=COUNTIF($C$2:$C$256,D2)
with the above formula, I'm checking if D2 exists in C2:C256 but I'm getting zero results though I know that D2(address) does exist in the range C2:C256. please help!!!!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Could you share screenshot etc. ?
below is an example. some address do have / and , in it. Hope below table makes sense.
2023 address2022 Address
215/20B ABCD XYZ 6097
5C, 256 New Drive FGH 6093
167 XYZ Road ABC 6098345 ABC Road OIU 1234
5C, 256 New Drive FGH 60931267 kjh/asd Cres OLM 1234
1209 jhgf Rd OLM 1234
167 XYZ Road ABC 6098
 
Upvote 0
Welcome to the MrExcel board!

So, what is wrong with your formula here used with your sample data?
(BTW, you should investigate XL2BB for providing better/neater sample data :))

22 08 28.xlsm
CDE
12023 address2022 Address
2215/20B ABCD XYZ 60975C, 256 New Drive FGH 60931
3167 XYZ Road ABC 6098345 ABC Road OIU 12340
45C, 256 New Drive FGH 60931267 kjh/asd Cres OLM 12340
51209 jhgf Rd OLM 12340
6167 XYZ Road ABC 60981
COUNTIF
Cell Formulas
RangeFormula
E2:E6E2=COUNTIF($C$2:$C$256,D2)
 
Upvote 0
Welcome to the MrExcel board!

So, what is wrong with your formula here used with your sample data?
(BTW, you should investigate XL2BB for providing better/neater sample data :))

22 08 28.xlsm
CDE
12023 address2022 Address
2215/20B ABCD XYZ 60975C, 256 New Drive FGH 60931
3167 XYZ Road ABC 6098345 ABC Road OIU 12340
45C, 256 New Drive FGH 60931267 kjh/asd Cres OLM 12340
51209 jhgf Rd OLM 12340
6167 XYZ Road ABC 60981
COUNTIF
Cell Formulas
RangeFormula
E2:E6E2=COUNTIF($C$2:$C$256,D2)
My formular eturns zero
 
Upvote 0
Hi

Check for extra spaces before or after the text.
 
Upvote 0
And what is the result if you compare two cells that are supposed to be identical, like C3=D6?
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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