Counting in IF stmt

Copper Contributor

I have a small Investment spreadsheet. Currently I'm tracking six symbols. One column, H5 - H10, tracks the change for each symbol. I'm trying to do two basic things, count the number of winners and count the number of losers in cells B13 and B14 and secondly, total the winnings and loses in B15 and B16.

7 Replies

@Jim-5 

COUNTIF() shall work, but better if you provide small sample file

@Sergei Baklan 

Thanks for the help.

Group 3A           
    TRADETRADE OPEN TRADE CLOSED  
ENTRY DATESYMBOLL/SSHARESENTRY PRICELAST PRICECHANGE$ GAIN/LOSSROITRADE P&LRISK 
    
  
 
   
 
           
66/24/19FFXEL1108.26108.27 $                 0.0 $            0.010.0%   
66/24/19GLDGLDL1133.5133.2 $             (0.30) $          (0.30)-0.2%   
66/24/19QQQL1188.5186.74 $             (1.76) $          (1.76)-0.9%   
66/24/19TLTL1132132.81 $               0.81 $            0.810.6%   
66/24/19VXXS126.626 $             (0.60) $            0.602.3%   
66/24/19XOPS12627.25 $               1.25 $            1.254.81%   
Open Trades  614.86614.27  $          61.009.92% $          -  #DIV/0! 
Stocks6          
Losers#NAME?    Open P&L $          61.00    
Winners           
$ winners     Open TradeAvg ROI2.35%   
$ Losers           
Avg win     Closed P&L $                -      
Avg lose           
Profit Factor     Return On Risk=    
            
            
            
Weekly CloseOpen & ClosedEquity ChangeWeekly Acct       
DateP/LPlus/MinusGain/Loss %       

@Sergei Baklan 

I'm trying =COUNTIF(H5,<0,"") for the losers but it's not working. BTW - is there a SUMIF () for the totals ?

 

 

@Jim-5 

The COUTIF() function only has 2 parameters: range and criteria

The formula will work is you select the collection of cells containing winners as losers, making that your range (H5:H10) and your criteria to "L" 

@Jim-5 

 

We may only make a guess where is what in your data. If H5:H10 is the range with numbers in dollars, when number of losers

=COUNTIF(H5:H10,"<0")

and for winners

=COUNTIF(H5:H10,">0")

@Sergei Baklan 

Thanks so much Sergei, the formulas worked perfect.

In order to total the numbers for losers and winners, is there an IF statement I use, perhaps =SUMIF () ?

@Jim-5 

You may count all not empty cells in this range

=COUNTA(H5:H10)