YTM calculation

If the formula for YTM is P = Sum Coupons/(1+YTM)^t + Last payment/(1+YTM)^T 1. What price is P - clean or dirty? 2. If between settlement date and first coupon payment t<1, so, do we use full coupon payment or coupon payment minus accrued interest? Can somebody send me a spreadsheet with exact calculations?

  1. Your formula indicates that P would be the clean price, for dirty you would need to add/subtract accrued to/from this. 2. I 'm not sure I understand what you are asking here. Are you wondering if the coupon occurs between trade and settle date? if so you would price the bond less any accrued up to trade date. The accrued would belong to the seller. Is this on the level III test, or just something you are working on? This looks to me like more of a level I thing. I haven’t been all the way through the books yet, but this seems to me like something that wouldn’t be level III.