COUNTIF formula

afountas

New Member
Joined
Jul 15, 2011
Messages
20
I need a countif formula that will subtract 1 if the total is greater than 0.

Thanks
 

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.
If the total is greater than 0, subtracting 1 will result in a value no less than 0, so maybe: (unless I misunderstand the question)

=MAX(COUNTIF(A1:A10,condition)-1,0)
 
Upvote 0
Still having trouble with this formula.

Needs to do the following

1. Count the # of times "spefic text instance" occurs in a column

2. Subtract the total of another cell if it is greater than or equal to 1.

So...

I have a seperate data set named 'yesno'

Yes
Yes
No
Yes

Want an equation that will COUNT the number of times yes occurs,
then subtract the value of another cell

ie

if in A3 I have COUNTIF(yesno,"yes")

my total will be 3. and I want to subtract cell A2 which has 4, but I do not want a negative value.
 
Upvote 0
How about
=if(COUNTIF(yesno,"yes")>A4,0,COUNTIF(yesno,"yes")-A4)

I realize you need quotes areound the "yesno", I am just going with your model.
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,304
Members
452,904
Latest member
CodeMasterX

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