Link to home
Start Free TrialLog in
Avatar of TAZI
TAZIFlag for South Africa

asked on

* HILAIRE * - NPER Excel Function in MSSQL

Hi All

I was searching through EE and viewed the question posted by ktrimmer: Payment function in MSSQL asked by ktrimmer on 11/26/2003 04:36AM PST  - Q_20809063.html

The solution was very informative and was of extreme assistance to me.

I am now looking for a function the equivalent of the excel NPER Function.
The following parameters are known.

Capital Amount - R 5000
Interest Rate - 20.3% .
Payment Amount - R 500 per month.

I want a function that can give me the number of months (taking into account interest) that a person will have to pay R500 for in order to settle a debt.

The excel funtion of NPER needs to be applied in MSSQL.
EG) =NPER(B5/12,B6,-B3)

B5 = 20.3%    B6 = 500, B3 = 5000

Hilaire .. your solution in previously asked question as mentioned above calculates rate as well as payment amount.  Is there a formulae/function in sql that will calculate No of Periods

Your assistance in this regard will be greatly appreciated

Thanking You
Regards
TAZI
Avatar of Hilaire
Hilaire
Flag of France image

Hi TAZI,

>>Is there a formulae/function in sql that will calculate No of Periods<<
No, you'll have to make your own

I tried to come up with my own version, based on an oarticle at this URL
http://www.duncanwil.co.uk/nper.html

I'm not a finance specialist, and I haven't found a correct algorithm for the moment

That would require more time than I have for the moment.
I'll let you know as soon as I find something better.

Hopefully other experts will join.

Cheers

Hilaire




ASKER CERTIFIED SOLUTION
Avatar of Hilaire
Hilaire
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi TAZI,

did you try my code above ?
Avatar of TAZI

ASKER

Hi

Yes, I tried your code and it works wonderfully.

Thanks a million
Sorry, I didn't get a chance to accept your question on Friday.  

Many Thanks
Regards
TAZI