Countif similar text values such as 3.1, 3.10, 4.1, 4.10

shyy

Well-known Member
Joined
Nov 6, 2008
Messages
1,484
Hey guys, I'm having trouble with counting numbers that are similar, example 3.1 and 3.10. We have violation codes that I am trying to count, problem is that both 3.1 and 3.10 come up with the same exact value although both are different digits. codes can go from 3.1 up to 3.15. Is there away to differentiate these numbers?

With the table below I should have (4) 3.1 codes & (3) 3.10 codes. What I get for both codes is 4 (treating both as 3.1)

[TABLE="width: 100"]
<tbody>[TR]
[TD]3.1[/TD]
[TD]4.10[/TD]
[TD]3.10[/TD]
[/TR]
[TR]
[TD]3.2[/TD]
[TD]4.1[/TD]
[TD]3.1[/TD]
[/TR]
[TR]
[TD]3.10[/TD]
[TD]3.15[/TD]
[TD]5.5[/TD]
[/TR]
[TR]
[TD]4.5[/TD]
[TD]3.1[/TD]
[TD]3.1[/TD]
[/TR]
[TR]
[TD]4.1[/TD]
[TD]4.1[/TD]
[TD]3.10[/TD]
[/TR]
</tbody>[/TABLE]

Thanks for your time
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
If the codes are text try using SUMPRODUCT:
Excel Workbook
ABCDEF
13.14.103.103.14
23.24.13.13.103
33.103.155.54.13
44.53.13.14.101
54.14.13.104.51
65.51
Sheet
 
Upvote 0
Thanks that did the trick, can't wait to try it at work. Curious why doesn't the countif work?

If the codes are text try using SUMPRODUCT:

ABCDEF

<colgroup><col style="width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:38px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]
[TD="align: right"]3.1[/TD]
[TD="align: right"]4.10[/TD]
[TD="align: right"]3.10[/TD]

[TD="align: right"]3.1[/TD]
[TD="align: right"]4[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]3.2[/TD]
[TD="align: right"]4.1[/TD]
[TD="align: right"]3.1[/TD]

[TD="align: right"]3.10[/TD]
[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="align: right"]3.10[/TD]
[TD="align: right"]3.15[/TD]
[TD="align: right"]5.5[/TD]

[TD="align: right"]4.1[/TD]
[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="align: right"]4.5[/TD]
[TD="align: right"]3.1[/TD]
[TD="align: right"]3.1[/TD]

[TD="align: right"]4.10[/TD]
[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="align: right"]4.1[/TD]
[TD="align: right"]4.1[/TD]
[TD="align: right"]3.10[/TD]

[TD="align: right"]4.5[/TD]
[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]

[TD="align: right"]5.5[/TD]
[TD="align: right"]1[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
F1=SUMPRODUCT(--($A$1:$C$5=E1))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
This way seems to work using COUNTIF
Excel Workbook
ABCDEF
13.14.103.103.14
23.24.13.13.103
33.103.155.54.13
44.53.13.14.101
54.14.13.104.51
65.51
Sheet
 
Upvote 0
COUNTIF sees 3.1 and 3.10 as the same.

Edit: Unless you do what AhoyNC showed in post 4. I've never seen that before.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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