# COUNT IF

#### Roses8

##### Active Member
Hi,

In a count if formula, I am trying to get a formula which does the following:

Count if in column D is =>0 and =<3

=COUNTIF(D:D,"=>0 AND =<3")

Thanks.

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### NBVC

##### Well-known Member
Try

=Sumproduct(--(D2:D1000>=0),--(D2:D1000<=3))

adjust ranges to suit

#### Krishnakumar

##### Well-known Member
Hi,

=SUM(COUNTIF(D:D,{">=0",">3"})*{1,-1})

HTH

#### Roses8

##### Active Member
thats great. Thank you

#### Peter_SSs

##### MrExcel MVP, Moderator
.. or this perhaps?
=COUNTIF(D:D,">=0")-COUNTIF(D:D,">3")

Replies
3
Views
436
Replies
1
Views
387
Replies
2
Views
128
Replies
1
Views
144
Replies
33
Views
1K

Threads
1,141,740
Messages
5,708,234
Members
421,553
Latest member
Geeyj

### 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

### 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