Percentages

bknight
BronzeLounger
Posts: 1469
Joined: 08 Jul 2016, 18:53

Percentages

Post by bknight »

I'm trying to calculate percentages of profitable and unprofitable trades, but I get an error in the first expressions.

Code: Select all

PosPerc: Count([Profit]>0)/count(not null([profit]))
and

Code: Select all

 NegPerc: Count([Profit]>0)/count(not null([profit]))
I get an error invalid syntax. I know there will have to be a multiply by 100 somewhere in the expression.

User avatar
HansV
Administrator
Posts: 78863
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Percentages

Post by HansV »

Try

PosPerc: Sum([Profit]>0)/Sum([Profit] Is Not Null)

and set the Format property of the PosPerc column to Percent.
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1469
Joined: 08 Jul 2016, 18:53

Re: Percentages

Post by bknight »

That worked, thanks