I am trying to find interest on a savings account for the following transactions in an mvc.net application:
Date Balance
----------- -------
01-Apr-2011 100
05-Apr-2011 200
30-Apr-2011 300
28-Jun-2011 400
The interest rate is 4% per annum.
Is there a simple way to calculate simple interest for these transactions for the quarter (i.e. 01-Apr-2011 - 31-Jun-2011)? Once I figure it out the calculation for one account, I will write a function to calculate it for all accounts. I got the Average Daily Available Balance(ADAB) as 24500 / 91 = $269.23. I used the below formula to get the simple interest for the quarter. Is it correct? Is there any other method to calculate the interest without using ADAB?
ADAB x (annual interest / 365 x number of days), or 269.23 x (0.04 / 365 x 91) = 2.6849
Sorry, neither calculation is correct. First, 4% interest should be expressed as 0.04. Next, the simple interest calculation should be ADAB x (annual interest / 365 x number of days), or 269.23 x (0.04 / 365 x 91) = 2.6849.
Because this is 4% simple interest for one quarter, if your answer is not roughly 1%, there is a problem.
Related
I got a basic issue looking like voodoo magic to me (a noob at google sheet):
What I need (a future value on a specific date)
Instead of the usual Future Value after "n" years or months I need to know the future value on a SPECIFIC DATE (eg.: on the 20th of March 2030 or in "2560" days) compounded either yearly or monthly with or without contribution.
What I have (the usual data for calculating FV):
Yearly (or monthly if it's easier) compound rate.
A present principal which compounds yearly or monthly
A regular monthly (or weekly) contribution to the principal.
SAMPLE FORMULAS I WORK WITH:
FV = SV*(((CAGR*100)/100)+1)^n.
FV - Future Value
SV - Starting Value
CAGR - Compound Annual Growth Rate
n - years
This tells me how much capital I will have given an annual growth rate after n years. But how to have the formula telling me what that capital will be on a specific date and also how to add the monthly/weekly contribution?
Any idea on how to achieve this?
Thanks a lot
I created a calculator in Google Sheets that has all the necessary formulas for FV, PV, PVAF, and "Compound FV on a SPECIFIC DATE".
Although, I believe this question is more suited to the Personal Finance & Money and Stackexchange site.
See this link for the calculator.
Description
In order to calculate the contributions into the formula we must use the following values:
p = initial value
n = compounding periods per year
r = nominal interest rate, compounded n times per year
i = periodic interest rate = r/n
y = number of years
t = number of compounding periods = n*y
d = periodic deposit
The formula for the future value of an annuity due is
d*(((1 + i)^t - 1)/i)*(1 + i)
(In an annuity due, a deposit is made at the beginning of a period and the interest is received at the end of the period. This is in contrast to an ordinary annuity, where a payment is made at the end of a period.)
The formula is derived, by induction, from the summation of the future values of every deposit.
The initial value, with interest accumulated for all periods, can simply be added.
pfv = p*(1 + i)^t
total = pfv + fv
So the overall formula is
I'm currently working on Node.js back-end application.
In a nutshell, it should compute a deposit needed to return to previous average after several days of not making deposits.
Let's say, our average deposit during the first three days was 100.
Then we were idle for 4 days, obviously our average would drop significantly.
How do we figure out what a single deposit must to be to return to the previous average of 100?
Help will be greatly appreciated.
Keep track the latest day when any last deposit was made. Let's say the average deposit was X on day a.
After the idle period, on day b, the total money needed to submit to restore the previous average deposit - (b - a) * X.
In case average can be fraction number, you also need to consider whether you will do ceiling or flooring after the calculation based on your requirement.
If someone is interested, I built the algorithm.
let x=(previousAveragePerDay*(datesConcluded+worthOfDiff))-r[0].sum;
where previousAveragePerDay is average during days of making a deposit
datesConcluded is the number of days of making a deposit
worthOfDiff is the number of days of not making a deposit
r[0].sum is the sum of all deposits made
How can I calculate time to decimal in Google sheets using a formula?
Basically, I have something like this set up:
Gross Pay: 16.63
Total Online: 1.53 (Represents 1 hour 53 minutes)
Hourly Rate: 10.87 (Just a formula that divides gross pay from total online)
Which is incorrect because 1 hour 53 minutes is 1.88 hours.
I need my hourly rate cell to have 16.63 / 1.88 to get the correct result. Anybody know any formula to do this?
Please try:
=int(A1)+(mod(A1,1)/0.6)
to return 1.88 from 1.53 in Cell A1.
Splits 1.53 at the decimal, removes the decimal ("x100") and divides the minutes by 60, to get their proportion of one hour.
I was recently wondering how http://500px.com calculates their "Pulse" rating.
The "Pulse" is a score from 1..100 based on the popularity of the photo.
I think it might use some of the following criteria:
Number of likes
Number of "favorites"
Number of comments
Total views
maybe the time since the photo has been uploaded
maybe some other non-obvious criteria like the users follower count, user rank, camera model or similar
How would I achieve some sort of algorithm like this?
Any advice on how to implement an algorithm with this criteria (and maybe some code) would be appreciated too.
I don't know too much about the site but systems like this generally work the same way. Normalize a set of weighted values to produce a single comparable value.
Define your list of rules, weight them based on importance, then run them all together to get your final value.
In this case it would be something like.
Total number of visits = 10%
Total number of Likes = 10%
Number of vists / number of likes = 40% (popularity = percentage of visitors that liked it)
number of Likes in last 30 days = 20% (current popularity)
author rating = 20%
Now we need to normalize the values for those rules. Depending on what your data is, scale of numbers etc this will be different for each rule so we need a workable value, say between 1 and 100.
Example normalizations for the above:
= percentage of vistors out of 50,000 vists (good number of vists)
(vists / 50000 ) * 100
= percentage of likes out of 10,000 likes (good number of likes)
(likes / 10000) * 100
= percentage of vistors that liked it
(likes / vists) * 100
= percentage of likes in last 30 days out of 1,000 likes (good number of likes for a 30 day period)
(likesIn30Days / 1000) * 100
= arbitrary rating of the author
Make sure all of these have a maximum value of 100 (if it's over bring it back down). Then we need to combine all these up depending on their weighting:
Popularity = (1 * 0.1) + (2 * 0.1) + (3 * 0.4) + (4 * 0.2) + (5 * 0.2)
This is all off the top of my head and rough. There are obviously also much more efficient ways to this as you don't need to normalize to a percentage at every stage but I hope it helps you get the gist.
Update
I've not really got any references or extra reading. I've never really worked with it as a larger concept only in small implementations.
I think most of what you read though is going to be methodological ranking systems in general and theories. Because depending on your rules and data format, your implementation will be very different. It seems such a huge concept when actually it will probably come down to arround 10 lines of code, not counting aggregating your data.
You may want to also refer to the following
How Reddit ranking algorithms work
How Hacker News ranking algorithm works
How to Build a Popularity Algorithm You can be Proud of
500px explains their (in the meantime outdated) Pulse ranking algorithm to some extend in their blog:
https://500px.com/blog/52/how-rating-works-and-why-there-s-a-lot-more-to-a-rating-than-just-a-number
Pretty interesting and different than what the solutions here on SO suggest so far.
Let's say you need to display a graphical representation of how well a baseball team is doing (my software problem is not related to sports but...).
Let say you chose that 25% of a gauge is related to the percentage of batters who hit during the first time at bat.
The next 25% related to the percentage of pitchers on the team who threw n number of strikes in a game.
The final 50% related to the percentage of batters on the team who scored during a game.
The obvious calculation is (.25 * percentage1) + (.25 * percentage2) + (.5 * percentage3). This will equal some final calculation < 100.
Let's say that you wanted to add some "negative" portion to the algorithm. Example, percentage of fielders who has an error during the game. How would that work as part of the algoritm? I don't think you can say that this percentage is -50% (negative) and then add an additional 50% somewhere to add up to 100%. That won't work because you'll potentially end up with a final calculation > 100.
UPDATED: (to give actual example)
Percentage 1 at 25%
Percentage 2 at 25%
Percentage 3 (this is negative) at -50%
Percentage 4 at ??? 100%
If we total the percentages then we are at 100%, but the calculations can come out to be > 100.
Just add it in. If the fielders are perfect, their error rate is 0, 0*(-.5) = 0, your calculation still has a possible maximum of 1. You don't need any correction factor.
You can measure how well a team did in comparison to an arbitrary limit, or possibly the worst of all the teams.
So, if you want errors to count for 50%, with an arbitrary limit of 100
.5 * (100 - NumberOfErrors)
Or you can measure a team against the worst in the league
.5 * 100 * (MostErrorsInTheLeague - NumberOfErrors) / MostErrorsInTheLeague
This way, the worst team will get a score of zero for that factor, and a team with zero errors will get the full fifty.
Mean Squared Error
Root Mean Square Deviation
One of these two terms should work well for comparing two algorithms where the error can be negative as well as positive.