title: How to Pricing IRS floating leg in quantlibxl
body: <p>I'm beginner in quantlibxl and I'm doing Marco Marchioro's lecture 2 <strong>IRS-Floating-leg</strong> Sheet's exercise.</p>
  
  <p>Here is my question:<br>
  When I use the given example, the both npvs(qunatlib calculation and excel calculation ) work.
  But if I change the pricing date, after the effective date, the qllegNPV gives the error message(#NUM). How do I fix it?</p>
  
  <p>The following is term sheet schedule:  </p>
  
  <blockquote>
    <p>Pricing date: 10/30/2015<br>
    Effective date: 07/23/2015<br>
    Terminate date: 7/23/2022<br>
    Tenor: 3M</p>
  </blockquote>
  
  <p>I try my best to explain my function in excel<br>
  To build the <strong>cash flow schedule</strong>(irs-float-schedule#0000):  </p>
  
  <pre><code>=qlSchedule(irs-float-schedule,7/23/2015,7/23/2022,3M,TARGET,Modified Following,Modified Following,Forwad,TRUE,,,,)  
  </code></pre>
  
  <p><strong>Forecast curve</strong>(swp-forecast#0000)  </p>
  
  <pre><code>=qlFlatForward(swp-forecast,0,TARGET,0.29%,Actual/360,Continous,SemiAnnual,,)  
  </code></pre>
  
  <p><strong>Libor Index</strong>(euribor#0000)  </p>
  
  <pre><code>=qlEuribor(euribor,3M,swp-forecast#0000,,)
  </code></pre>
  
  <p><strong>Discount curve</strong>(swp-discount#0000):  </p>
  
  <pre><code>=qlFlatForward(swp-discount,0,TARGET,4%,Actual/360,Continous,SemiAnnual,,)  
  </code></pre>
  
  <p><strong>IRS Floating leg</strong>(irs-float-leg#0000):  </p>
  
  <pre><code>=qlIborLeg(irs-float-leg,Following,5000000,irs-float-schedule#0000,,,Actual/360,0,1,euribor,0,0,,)
  </code></pre>
  
  <p><strong>legNPV</strong>:  </p>
  
  <pre><code>=qlLegNPV(irs-float-leg#0000,swp-discount#0000)
  </code></pre>
  
  <p>Thanks for your help.</p>