ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

How to Populate Excel using Bing Chat GPT-4

Автор: Matrix Inception

Загружено: 2023-03-25

Просмотров: 4192

Описание: How to populate Excel file with a monthly mortgage amortization schedule using Bing Chat GPT-4.

Prompt to Bing Chat (Precise): please write VBA code to populate excel file with a mortgage monthly amortization schedule. please start with a summary of parameters: starting principal $500,000, annual interest rate 5%, term 25 years before starting the header on row 7

Working VBA code generated by Bing Chat:

Sub AmortizationSchedule()
' Declare variables
Dim StartingPrincipal As Double
Dim AnnualInterestRate As Double
Dim TermInYears As Integer
Dim MonthlyPayment As Double
Dim MonthlyInterestRate As Double
Dim NumberOfPayments As Integer
Dim PaymentNumber As Integer
Dim InterestPaid As Double
Dim PrincipalPaid As Double
Dim EndingBalance As Double

' Set values for variables
StartingPrincipal = 500000
AnnualInterestRate = 0.05
TermInYears = 25

' Calculate monthly interest rate and number of payments
MonthlyInterestRate = AnnualInterestRate / 12
NumberOfPayments = TermInYears * 12

' Calculate monthly payment using PMT function
MonthlyPayment = Application.WorksheetFunction.Pmt(MonthlyInterestRate, NumberOfPayments, -StartingPrincipal)

' Set initial value for ending balance
EndingBalance = StartingPrincipal

' Print summary of parameters
Range("A1").Value = "Starting Principal"
Range("B1").Value = StartingPrincipal
Range("A2").Value = "Annual Interest Rate"
Range("B2").Value = AnnualInterestRate
Range("A3").Value = "Term (Years)"
Range("B3").Value = TermInYears
Range("A4").Value = "Monthly Payment"
Range("B4").Value = MonthlyPayment

' Print headers for amortization schedule table
Range("A7").Value = "Payment Number"
Range("B7").Value = "Beginning Balance"
Range("C7").Value = "Payment"
Range("D7").Value = "Interest Paid"
Range("E7").Value = "Principal Paid"
Range("F7").Value = "Ending Balance"

' Loop through each payment and calculate values for table
For PaymentNumber = 1 To NumberOfPayments
InterestPaid = EndingBalance * MonthlyInterestRate
PrincipalPaid = MonthlyPayment - InterestPaid
EndingBalance = EndingBalance - PrincipalPaid

' Print values for current payment in table
Cells(PaymentNumber + 7, 1).Value = PaymentNumber
Cells(PaymentNumber + 7, 2).Value = EndingBalance + PrincipalPaid
Cells(PaymentNumber + 7, 3).Value = MonthlyPayment
Cells(PaymentNumber + 7, 4).Value = InterestPaid
Cells(PaymentNumber + 7, 5).Value = PrincipalPaid
Cells(PaymentNumber + 7, 6).Value = EndingBalance

Next PaymentNumber

End Sub

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
How to Populate Excel using Bing Chat GPT-4

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]