Shareholder Yield

It all depends on whether you want to include debt reduction or not. There’s no right or wrong answer.

Is there a formula I can see for he built in function?

The formula for the prebuilt ShareholderYield factor could not be easily reproduced in a custom formula. It does not use DbtLTReduced or DbtLTIssued.

The complication is in the way it gets EqPurch and EqIssued. If the stock is a prelim (CompleteStmt=0), and either EqPurch and EqIssued is NA, then it uses the PTM values. If they are not NA, then it uses TTM values. Aside from that, the formula used looks like this: (eval(IAD>0,IAD/Price,0) + ISNA((EqPurchXXX-EqIssuedXXX)/MktCap, 1-Shares(0,Qtr,KEEPNA)/SharesPYQ))*100)
The ‘XXX’ means that it uses either TTM or PTM depending the prelim rules I mentioned above. Also notice that if EqPurch or EqIssued was NA, then it uses the change in shares as a substitute.