Countif 4 digit Number starts with

blossomthe2nd

Active Member
Joined
Oct 11, 2010
Messages
450
Hi guys

I am trying to write a query that counts the number of 4 digit numbers that start with 3,

I have the text verson

=COUNTIF(A2:A7,"3???")

But this only finds 4 digits that start with 3 if it contains text ? so it will find 3ABC but not 3456 !

Can anyone help please ?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I would do it like this...

Excel 2003 and earlier:
Code:
=COUNTIF(A2:A7,">=3000")-COUNTIF(A2:A7,">=4000")

Excel 2007 and later:
Code:
=COUNTIFS(A2:A7,">=3000",A2:A7,"<4000")
 
Upvote 0
Thanks Guys

Do you know if there is a way to just count Whole numbers ?

Or is there a way on formating to round DOWN a decimal ?

Thanks
 
Upvote 0
Do you know if there is a way to just count Whole numbers ?
Try either of these
Code:
=SUMPRODUCT(--(A2:A7>=3000),--(A2:A7<=4000),--(INT(A2:A7)=A2:A7))
 
=SUMPRODUCT(--(A2:A7>=3000),--(A2:A7<=4000),--(LEN(A2:A7)=4  ))

Or is there a way on formating to round DOWN a decimal ?
Why do you want to round down... do you plan to sum the numbers as well?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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