turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- difference between NPV function in SAS vs Excel

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2017 08:54 AM

Dear all,

Can you please help me understand the difference between the output in SAS vs Excel when using NPV function?

I have the below example:

No | Cashflow |

1 | 6000 |

2 | 5000 |

3 | 4500 |

4 | 4000 |

5 | 3500 |

6 | 2500 |

Rate | 5.53% |

When computing NPV in SAS :

NPV=(rate, freq, cashflows) ->

NPV =(5.53%, 6, 6000,5000,4500,4000,3500,2500)=25495.37.

The excel output is NPV=21713.68.

I can not figure out the difference or if i computed wrongly in SAS.

Thank you very much,

Accepted Solutions

Solution

04-19-2017
06:15 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to cati

04-18-2017 09:06 AM

Google result:

http://support.sas.com/kb/22/936.html

Diff is due to considering first of month payments or end of month payments.

All Replies

Solution

04-19-2017
06:15 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to cati

04-18-2017 09:06 AM

Google result:

http://support.sas.com/kb/22/936.html

Diff is due to considering first of month payments or end of month payments.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

04-19-2017 06:40 AM

Thank you for the answer.

Cati

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to cati

04-18-2017 09:28 AM

As Reeza mentioned, there is a difference in the two sets of calculations. Should the first amount be discounted or not?

But there is also an error in your use of the NPV function. The second number is the frequency of the amounts (how many per time period), not the total number of amounts. So you should be using 1 instead of 6. Here is a test program you can run that illustrates all of these considerations. (You'll have to forgive my formulas for NPV ... they're just in the form that occurred to me as I was programming.)

data test;

input amount;

retain total1 total2 0;

total1 = total1 + (1/1.0553)**_n_ * amount;

total2 = total2 + (1/1.0553)**(_n_-1) * amount;

datalines;

6000

5000

4500

4000

3500

2500

;

proc print;

run;

data _null_;

npv1 = npv(5.53, 6, 6000, 5000, 4500, 4000, 3500, 2500);

npv2 = npv(5.53, 1, 6000, 5000, 4500, 4000, 3500, 2500);

put npv1= npv2=;

run;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Astounding

04-19-2017 06:25 AM

Thank you very much for your answer.

It is really helpful.

can i have one more question?

for example, i have 2 loans, one with monthly payments, and the other with quarterly payments. From what i understood when computing npv the frequency for the first one should be 1. For the second one, how we should consider the frequency?

thank you

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to cati

04-19-2017 06:46 AM

I think the answer depends on the interest rate and whether it is a straight interest rate or compounded. I'm afraid I haven't used NPV function before this, however, so I don't know all the details. It's possible that you divide the interest rate by 12 (for monthly) and then use a frequency of 1.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Astounding

04-19-2017 08:33 AM

Thank you for answering.

Best regards,

Cati