# function or formela

#### sitelbanat

##### Board Regular
This works great

=COUNTIF(O69:O82,">0")-(1-SUMPRODUCT(--(O69:O82>0),--(ISNUMBER(E69:E82)),E69:E82))

But I need to add a IF function at the end of the formela. I was wondering would I use AND IF or just IF?
I want the IF function to look at the selected cells from E69:E82 and if the total value is <0 than +1 to total count of O69:O82.

### Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

#### fairwinds

##### MrExcel MVP
Hi,

+(sum(E69:E82)<0)

at the end of your formula.

Thank You

#### sitelbanat

##### Board Regular

why isnt this working?

=COUNTIF(O69:O82,">0")-(1-SUMPRODUCT(--(O69:O82>0),--(ISNUMBER(E69:E82)),E69:E82)),IF(SUM(E69:E82)<0,+1,"")

#### sitelbanat

##### Board Regular
I found the solution

=COUNTIF(O69:O82,">0")-(1-SUMPRODUCT(--(O69:O82>0),--(ISNUMBER(E69:E82)),E69:E82))+(SUM(E69:E82)<0+1)

I solved it

#### fairwinds

##### MrExcel MVP
sitelbanat said:
I found the solution

=COUNTIF(O69:O82,">0")-(1-SUMPRODUCT(--(O69:O82>0),--(ISNUMBER(E69:E82)),E69:E82))+(SUM(E69:E82)<0+1)

That would add one if sum is less than one... but as long as you are happy...

#### sitelbanat

##### Board Regular
no its not working, I need it to coult the right amount if E range =0

Replies
10
Views
637
Replies
2
Views
139
Replies
3
Views
255
Replies
4
Views
191
Replies
4
Views
389

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,499
Messages
5,832,067
Members
430,109
Latest member
tinezi

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

### Which adblocker are you using?

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

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