We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide
Looking for Excel Spreadsheet Expert
Comments
-
Yes, I don't think my formula is compounding correctly. Back to my macro solution then...0
-
RacingDriver wrote: »Ok, I think I understand what you are trying to do. To do this calculation you can use the VBA macro I have written below. If you are unsure how to add the VBA macro to Excel let me know what version of Excel you are using (e.g. 2010, 2016 etc.) and I can try and help.
This assumes that you have three values in your spreadsheet in the following cells:
Monthly Deposit in B1 (e.g. 100)
Annual Interest in B2 (e.g. 2)
Months in B3 (e.g. 12)
The macro then outputs your final value to cell B5
If your values are in different cells, you can update the macro below by changing the parts in red/bold in the format row, column
Sub InterestCalc()
'Tell Excel that the values we are going to use are numbers
Dim MonthlyDeposit As Variant
Dim MonthlyInterest As Variant
Dim Months As Variant
Dim Count As Variant
Dim FinalValue As Variant
'Read in values from spreadsheet;
MonthlyDeposit = Cells(1, 2) 'In format (row, column) (e.g. this is B1)
MonthlyInterest = ((Cells(2, 2) / 100) / 12) + 1 'B2
Months = Cells(3, 2) 'B3
For i = 1 To Months
FinalValue = FinalValue + (MonthlyDeposit * i) 'Add monthly deposit
FinalValue = FinalValue * MonthlyInterest 'Add monthly interest
Next i
Cells(5, 2) = FinalValue 'Output final value
End Sub
I am embarrassed to say - I havent got a clue how to do this. It is way over my head. I am using Excel 2016. If you have some free time, and want to help a novice - thats great. The way I did it, by using 1 row per investment, resulted in 240 rows (as you know), and about 7 pages, if I want to print it. It would be amazing to have it accomplish the same thing in 1 row, and be able to change the amount, rate, years/months, and still come out with the correct answer.0 -
I am embarrassed to say - I havent got a clue how to do this. It is way over my head. I am using Excel 2016. If you have some free time, and want to help a novice - thats great. The way I did it, by using 1 row per investment, resulted in 240 rows (as you know), and about 7 pages, if I want to print it. It would be amazing to have it accomplish the same thing in 1 row, and be able to change the amount, rate, years/months, and still come out with the correct answer.
1) Open Excel
2) Press Alt+F11 to open VBE
3) Click "ThisWorkbook" on the left hand side
4) Click Insert -> Module and paste my code above0 -
I open Excel, and hit ALT+F11, and my screen gets dimmer...lol. I am feeling pretty lame. I guess I have a lot to learn.0
-
Example here https://files.fm/u/mfj277bn0
-
Good thing you're not putting anything malicious in there! I once sent someone some code they insisted I wrote for them, and I coded it to do what the wanted but about 1% of the time to scream "Nooooooooo" when the file was closed. That seemed like a fair price for the work I did!RacingDriver wrote: »1) Open Excel
2) Press Alt+F11 to open VBE
3) Click "ThisWorkbook" on the left hand side
4) Click Insert -> Module and paste my code aboveI am a Chartered Financial Planner
Anything I say on the forum is for discussion purposes only and should not be construed as personal financial advice. It is vitally important to do your own research before acting on information gathered from any users on this forum.0 -
Thank You Racing Driver. I dont know how you did it. Some day hope to. But - it works, and I am grateful.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 354.8K Banking & Borrowing
- 254.5K Reduce Debt & Boost Income
- 455.6K Spending & Discounts
- 247.6K Work, Benefits & Business
- 604.5K Mortgages, Homes & Bills
- 178.6K Life & Family
- 262.2K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.7K Read-Only Boards