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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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
Hi Macho,

Its grand I put a second column in with

=ROUNDDOWN(A2,0) and it works perfect

Thanks for your help
 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,054
Members
448,940
Latest member
mdusw

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