Solved

EXCEL formula in ASP Classic

Posted on 2011-02-17
3
384 Views
Last Modified: 2012-05-11
Hello,

I have a formula in Excel which I would like to present online in a HTML form and then calculate the result in ASP Classic, however if someone has a way of doing it in Javascript that would be great as well.

This is the formula in Excel and potential values for each fields. The financial formulas result C14 is how much you will have to have saved up when you retire if you like to withdraw C14 each year if the interest is D14 over E14 years.

Result Field:
=C14*(1+D14%)*((1-(1/((1+D14%)^E14)))/D14%)

C14: (how much you want to withdraw each year)
10000

D14: (% interest each year)
5

E14: (how many years)
20


I have a form with three fields, one for C14, D14 and E14 which I will POST or GET depening on what you recommend.

Now my biggest problem is the ^ in ASP which I haven't been able to figure out and I'm probably getting a lot of the formula wrong anyways..

Appreciate any help.


0
Comment
Question by:SvassUK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Expert Comment

by:Slim81
ID: 34918431
This is untested, I am testing it now....


dim C14, D14, E14, resultField

C14 = CDbl(request.form("C14"))
D14 = CDbl(request.form("D14"))
E14 = CDbl(request.form("E14"))

resultField = C14 * (1+(D14/100)) * ((1-(1/((1+(D14/100))Exp(E14))))/(D14/100))

Open in new window

0
 

Author Comment

by:SvassUK
ID: 34918604
Hi Slim81

Getting error for the code,

Expected ')'

/calculation.asp, line 20

resultField = C14 * (1+(D14/100)) * ((1-(1/((1+(D14/100))Exp(E14))))/(D14/100))
---------------------------------------------------------^

Open in new window

0
 
LVL 4

Accepted Solution

by:
Slim81 earned 500 total points
ID: 34918644
I was wrong with, you still use the Carrot for exponents....

Here is the code that I was able use:
<%
dim C14, D14, E14, resultField

'C14 = CDbl(request.form("C14"))
'D14 = CDbl(request.form("D14"))
'E14 = CDbl(request.form("E14"))

C14 = 10000
D14 = 5
E14 = 20

resultField = C14 * (1+(D14/100)) * ((1-(1/((1+(D14/100))^(E14))))/(D14/100))
%>

Open in new window


By using the Round(resultField, 2), the output was 130853.21

Let me know if you need further help or if I am way off base!

Thanks,
Slim
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question