Count IF question

galenweaver

New Member
Joined
Jul 13, 2011
Messages
7
I have a column of data, many of the numbers in the column have the same first 3 digits. I want to count the number of times a value occurs in the column with the same first 3 digits.

Here is the formula I am using:=COUNTIF($A$1:$A$1117,"116*")

It returns "0" as the value and I can't figure out why it won't work. I want to see how many timed times 116 occurs in the A column.

Thanks,
Galen
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Welcome to the board...

It's because the values in column A are numbers, but "116*" is a text string
Even though the * is a wildcard, simply adding the "'s makes it a text string..


Try
=SUMPRODUCT(--(LEFT($A$1:$A$1117,3)="116"))


Hope that helps.
 
Upvote 0
That worked. Now I want to use a value in a cell in place of the 116, any ideas?

And just so you know this forum rocks! You guys are great!
I can't believe I got 2 solutions in 5 minutes.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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