Countif not working...

bob ridolfo

New Member
Joined
Aug 17, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am working on a spreadsheet with a text string using 22 characters. When i do a countif to check how many of the same values exist I am getting some weird results:

abcountifresult
125600591850001905187 256005918500019051870010 =countif(B:B,B1)6
225600591850001905187 256005918500019051870011 =countif(B:B,B2)6
325600591850001905187 256005918500019051870012 =countif(B:B,B3)6
425600591850001905187 256005918500019051870013 =countif(B:B,B4)6
525600591850001905187 256005918500019051870013 =countif(B:B,B5)6
625600591850001905187 256005918500019051870013 =countif(B:B,B6)6

I don't understand the result - rows 1 - 3 should be 1 and rows 4-6 should be 3
Columns A&B are formatted as TEXT
Is there a limit to the number of characters you can use in a "countif" statement??

Thanks
bob
 

Attachments

  • countif.png
    countif.png
    9.1 KB · Views: 4

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi & welcome to MrExcel.
Countifs will "convert" text to numbers where possible try it like
Fluff.xlsm
ABC
12.56E+192560059185000190518700101
22.56E+192560059185000190518700111
32.56E+192560059185000190518700121
42.56E+192560059185000190518700133
52.56E+192560059185000190518700133
62.56E+192560059185000190518700133
Sheet5
Cell Formulas
RangeFormula
C1:C6C1=SUM(IF($B$1:$B$10=B1,1,0))
 
Upvote 0
Hi & welcome to MrExcel.
Countifs will "convert" text to numbers where possible try it like
Fluff.xlsm
ABC
12.56E+192560059185000190518700101
22.56E+192560059185000190518700111
32.56E+192560059185000190518700121
42.56E+192560059185000190518700133
52.56E+192560059185000190518700133
62.56E+192560059185000190518700133
Sheet5
Cell Formulas
RangeFormula
C1:C6C1=SUM(IF($B$1:$B$10=B1,1,0))
Thank you - did not think to use a "sum(if)" versus countif but it works great.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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