Managing Debt
Each topic starts with a real scenario and a bar model, then three levels of exercises. Level 1 (Guided) fills in the blanks of a finished function. Level 2 (Practice) applies it to new numbers. Level 3 (Challenge) asks a new question with little scaffolding. The R and Python exercises run in your browser: click Run Code to try, Submit Answer to check, and use the hint or solution if you get stuck. Excel exercises have a solution you can reveal.
1 Book Topics
- Debt hierarchy: every debt has a price (its APR); toxic debt (15 to 29% APR: credit cards, payday loans) gets attacked first, moderate debt (5 to 10%: car loans, private student loans) gets paid down steadily, and strategic debt (3 to 7%: mortgages, federal student loans) gets paid on schedule
- Credit cards: pay them off before nearly every other goal (except insurance deductibles and an employer match); the playbook is stop using them, negotiate the APR, pick avalanche or snowball, consider a 0% transfer or cheaper loan, and automate minimums; once paid in full monthly, use cards as a payment tool
- Student loans: the return depends on the income premium the degree creates; the 1× rule caps total debt at your expected first year salary, which works out to roughly 14% of gross pay on a standard 10 year plan at 6.5%
- Federal IDR plans: payments are a share of discretionary income (AGI minus a multiple of the poverty guideline); SAVE ended in March 2026, RAP starts July 2026 (1 to 10% of AGI, 30 years), IBR is the stable fallback, and PSLF forgives the rest after 10 years of public service
- Pay off vs. invest: compare the loan rate to your expected after tax return (above 6% pay off, 4 to 6% do both, below 4% invest), then add a peace of mind premium
- Car loans: depreciating assets financed at 7 to 9%; buy used, pay cash, keep loans under 36 months, follow the 20/4/10 rule
- Debt and the FOO: high interest debt is step 3, low interest debt is step 9; moderate debt sits in between, after emergency reserves
2 APR vs. APY
Lenders quote the APR. You actually pay the APY, which is higher because interest compounds.
Formula: APY = (1 + APR ÷ n)^n − 1, where n is the number of compounding periods per year
Example: a 24% APR compounded daily is about 27.1% APY. On a $10,000 balance that is an extra $310 a year.
The gap grows as the APR grows. It also grows with how often interest compounds, but most of the jump happens going from yearly to monthly. Daily adds only a little more. If APR and APY are the same, interest compounds once a year.
2.1 Level 1: Guided
Fill in the blanks to finish apr_to_apy(), then find the APY of a 24% APR card that compounds daily. Give the answer as a decimal.
Put the APR in A2 (0.24) and the compounding periods in B2 (365). Find the APY in C2.
=(1 + A2/B2)^B2 - 1This returns 0.2711, or 27.1%. Excel’s =EFFECT(A2, B2) gives the same answer.
The APR is split across every compounding period, and it compounds that many times a year.
def apr_to_apy(apr, periods_per_year=365):
return (1 + apr / periods_per_year) ** periods_per_year - 1
apr_to_apy(0.24)The APR is split across every compounding period, and it compounds that many times a year.
apr_to_apy <- function(apr, periods_per_year = 365) {
(1 + apr / periods_per_year)^periods_per_year - 1
}
apr_to_apy(0.24)2.2 Level 2: Practice
Some cards compound monthly instead of daily. What is the APY of the same 24% APR compounded 12 times a year?
Change B2 to 12.
The same formula returns 0.2682, or 26.8%. Monthly compounding costs a little less than daily.
Pass the APR and periods_per_year=12.
apr_to_apy(0.24, periods_per_year=12)Pass the APR and periods_per_year = 12.
apr_to_apy(0.24, periods_per_year = 12)2.3 Level 3: Challenge
A store card charges 29% APR, compounded daily. On a $10,000 balance, how many extra dollars a year does compounding add on top of the APR?
Find the hidden cost in one formula.
=10000 * (EFFECT(29%, 365) - 29%)This returns $462.74 a year.
Find apr_to_apy(0.29), subtract 0.29, and multiply by 10000.
10000 * (apr_to_apy(0.29) - 0.29)Find apr_to_apy(0.29), subtract 0.29, and multiply by 10000.
10000 * (apr_to_apy(0.29) - 0.29)3 Minimum Payments
Minimum payments barely touch the balance. Most of each payment goes to interest. As the balance falls, a little more of each payment goes to principal, and the formula accounts for that.
Formula: Months to pay off = −ln(1 − r × Balance ÷ Payment) ÷ ln(1 + r), where r = APR ÷ 12
Example: $5,000 at 22% APR, paying $100 a month. The first month’s interest is about $92, so only $8 reduces the balance. Payoff takes about 137 months (11 years), and you pay about $13,700 in total.
The formula only works when the payment is bigger than the first month’s interest. If it isn’t, the balance never shrinks, and the answer comes back as NaN (not a number). Small increases in the payment cut years off the debt.
3.1 Level 1: Guided
Fill in the blanks to finish months_to_payoff(), then find how many months it takes to clear $5,000 at 22% APR paying $100 a month.
Put the balance in A2 (5000), the payment in B2 (100), and the APR in C2 (0.22). Find the months in D2.
=NPER(C2/12, -B2, A2)This returns about 136.8 months, or 11 years.
The monthly rate is the APR divided by 12. The formula uses the balance in the second blank.
import math
def months_to_payoff(balance, monthly_payment, apr):
r = apr / 12
return -math.log(1 - r * balance / monthly_payment) / math.log(1 + r)
months_to_payoff(5000, 100, 0.22)The monthly rate is the APR divided by 12. The formula uses the balance in the second blank.
months_to_payoff <- function(balance, monthly_payment, apr) {
r <- apr / 12
-log(1 - r * balance / monthly_payment) / log(1 + r)
}
months_to_payoff(5000, 100, 0.22)3.2 Level 2: Practice
Double the payment to $200 a month. How much total interest do you pay? (Total paid is roughly months × payment.)
Change B2 to 200 and find the interest in E2.
=D2*B2 - A2This returns about $1,750, down from about $8,700 at $100 a month.
Pass 5000, 200, and 0.22. Then multiply the months by the payment.
months = months_to_payoff(5000, 200, 0.22)
months * 200 - 5000Pass 5000, 200, and 0.22. Then multiply the months by the payment.
months <- months_to_payoff(5000, 200, 0.22)
months * 200 - 50003.3 Level 3: Challenge
You want the $5,000 card (22% APR) gone in 3 years. Write payment_needed(balance, apr, years) using the loan payment formula, Payment = Balance × r(1 + r)^n ÷ ((1 + r)^n − 1) with r = APR ÷ 12 and n = months, and find the monthly payment.
Find the payment in one formula.
=PMT(22%/12, 36, -5000)This returns $190.95 a month.
Set the monthly rate r to apr / 12 and the number of payments n to years * 12, then return balance * r * (1 + r) ** n / ((1 + r) ** n - 1).
def payment_needed(balance, apr, years):
r = apr / 12
n = years * 12
return balance * r * (1 + r) ** n / ((1 + r) ** n - 1)
payment_needed(5000, 0.22, 3)Set the monthly rate r to apr / 12 and the number of payments n to years * 12, then return balance * r * (1 + r)^n / ((1 + r)^n - 1).
payment_needed <- function(balance, apr, years) {
r <- apr / 12
n <- years * 12
balance * r * (1 + r)^n / ((1 + r)^n - 1)
}
payment_needed(5000, 0.22, 3)4 Total Interest Over a Loan’s Life
For any installment loan (car, mortgage, student loan), the real cost is everything you pay minus what you borrowed.
Formula: Total Interest = (Monthly Payment × Number of Payments) − Loan Principal
Example: a $30,000 car loan at 7%. Over 6 years ($512 a month) you pay $6,864 in interest. Over 4 years ($719 a month) you pay $4,512. The shorter term saves $2,352.
The book rounds the payments to whole dollars. The exact payments are $511.47 and $718.39, so the exact interest is a few dollars lower. Each extra year on the loan adds interest, but the monthly payment drops less than you might expect.
4.1 Level 1: Guided
Fill in the blanks to finish total_interest(), then find the interest on a $30,000 car loan paid at $512 a month for 6 years.
Put the payment in A2 (512), the months in B2 (72), and the principal in C2 (30000). Find the interest in D2.
=A2*B2 - C2This returns $6,864.
Everything you pay, minus the amount you borrowed.
def total_interest(monthly_payment, n_months, principal):
return (monthly_payment * n_months) - principal
total_interest(512, 72, 30000)Everything you pay, minus the amount you borrowed.
total_interest <- function(monthly_payment, n_months, principal) {
(monthly_payment * n_months) - principal
}
total_interest(512, 72, 30000)4.2 Level 2: Practice
The same loan over 4 years costs $719 a month. How much interest does the shorter loan save compared with the 6-year loan?
Add the 4-year loan in row 3 and find the savings.
=D2 - D3The 4-year loan’s interest is $4,512, so it saves $2,352.
Four years is 48 months. Then subtract the smaller interest from the larger.
six_year = total_interest(512, 72, 30000)
four_year = total_interest(719, 48, 30000)
six_year - four_yearFour years is 48 months. Then subtract the smaller interest from the larger.
six_year <- total_interest(512, 72, 30000)
four_year <- total_interest(719, 48, 30000)
six_year - four_year4.3 Level 3: Challenge
Where do payments like $512 come from? Write loan_payment(principal, annual_rate, years) with the loan payment formula, then find the total interest on the $30,000 loan at 7% over 5 years.
Find the 5-year payment, then the total interest.
=PMT(7%/12, 60, -30000)*60 - 30000The payment is $594.04 and the interest is $5,642.16.
Set the monthly rate r to annual_rate / 12 and n to years * 12; the payment is principal * r * (1 + r) ** n / ((1 + r) ** n - 1). Then use total_interest(payment, 60, 30000).
def loan_payment(principal, annual_rate, years):
r = annual_rate / 12
n = years * 12
return principal * r * (1 + r) ** n / ((1 + r) ** n - 1)
total_interest(loan_payment(30000, 0.07, 5), 60, 30000)Set the monthly rate r to annual_rate / 12 and n to years * 12; the payment is principal * r * (1 + r)^n / ((1 + r)^n - 1). Then use total_interest(payment, 60, 30000).
loan_payment <- function(principal, annual_rate, years) {
r <- annual_rate / 12
n <- years * 12
principal * r * (1 + r)^n / ((1 + r)^n - 1)
}
total_interest(loan_payment(30000, 0.07, 5), 60, 30000)5 Student Loan to Income & Standard Payment
The 1× rule says your student loans should not be bigger than your expected first year salary. Two numbers check it: the loan to income ratio, and the monthly payment that loan creates on a standard 10 year plan.
Formula: Loan to income ratio = Total loans ÷ Expected salary, and Monthly payment = Loan × r(1 + r)^n ÷ ((1 + r)^n − 1), where r = yearly rate ÷ 12 and n = 120 payments
Example: $45,000 ÷ $42,000 = about 1.07×, and the standard payment at 6.5% is about $511 a month.
A ratio above 1.0 means the loan bar runs past the salary line. At exactly 1×, every dollar borrowed costs about $0.0114 a month, so the payment is about 14% of gross pay no matter the major. What changes is how many dollars are left over.
5.1 Level 1: Guided
Fill in the blanks to finish loan_income_ratio(), then check $45,000 of loans against a $42,000 expected salary.
Put the loans in A2 (45000) and the salary in B2 (42000). Find the ratio in C2.
=A2 / B2This returns 1.07, just over the 1× rule.
Loans divided by salary.
def loan_income_ratio(loan_total, expected_salary):
return loan_total / expected_salary
loan_income_ratio(45000, 42000)Loans divided by salary.
loan_income_ratio <- function(loan_total, expected_salary) {
loan_total / expected_salary
}
loan_income_ratio(45000, 42000)5.2 Level 2: Practice
What is the standard 10-year monthly payment on that $45,000 at 6.5%?
Find the payment in one formula.
=PMT(6.5%/12, 120, -45000)This returns $510.97 a month.
The rate and years already default to 6.5% and 10, so only the principal is needed.
monthly_standard_payment(45000)The rate and years already default to 6.5% and 10, so only the principal is needed.
monthly_standard_payment(45000)5.3 Level 3: Challenge
A nursing graduate follows the 1× rule exactly: $60,000 of loans on a $60,000 salary. What share of gross monthly pay goes to the standard payment? Give a decimal.
Find the payment, then divide by monthly gross pay.
=PMT(6.5%/12, 120, -60000) / (60000/12)This returns 0.136, about 14% of gross pay.
Monthly gross pay is the salary divided by 12.
monthly_standard_payment(60000) / (60000 / 12)Monthly gross pay is the salary divided by 12.
monthly_standard_payment(60000) / (60000 / 12)6 Income Driven Repayment Monthly Payment
Federal IDR plans protect part of your income and charge a percentage of the rest (your discretionary income).
Formula: Monthly payment = (AGI − threshold × Federal Poverty Guideline) × payment rate ÷ 12
Example (IBR): ($50,000 − 1.5 × $15,650) × 10% ÷ 12 = about $221 a month. For IBR loans from before July 2014 (15% rate), it is about $332.
If your AGI is below the protected amount, the payment is $0. Each extra $1,000 of income above that line adds only about $8 a month under IBR. SAVE used the same formula with a 225% threshold and a 5% undergraduate rate, but it ended in March 2026. RAP uses a sliding share of total AGI instead, so this function does not cover it.
6.1 Level 1: Guided
Fill in the blanks to finish idr_monthly_payment() for IBR, then find the payment on a $50,000 AGI. Discretionary income is AGI minus 1.5 × the $15,650 poverty guideline.
Put the AGI in A2 (50000). Find the monthly IBR payment in B2.
=ROUND(MAX(0, A2 - 1.5*15650) * 10% / 12, 2)This returns $221.04.
Use the threshold to scale the poverty guideline, then apply the payment rate.
def idr_monthly_payment(agi, poverty_guideline=15650, threshold_pct=1.5, payment_rate=0.10):
discretionary = max(0, agi - poverty_guideline * threshold_pct)
return round((discretionary * payment_rate) / 12, 2)
idr_monthly_payment(50000)Use the threshold to scale the poverty guideline, then apply the payment rate.
idr_monthly_payment <- function(agi, poverty_guideline = 15650,
threshold_pct = 1.5, payment_rate = 0.10) {
discretionary <- max(0, agi - poverty_guideline * threshold_pct)
round((discretionary * payment_rate) / 12, 2)
}
idr_monthly_payment(50000)6.2 Level 2: Practice
IBR loans from before July 2014 use a 15% payment rate. What is the payment on the same $50,000 AGI?
Change 10% to 15% in the formula.
=ROUND(MAX(0, A2 - 1.5*15650) * 15% / 12, 2)This returns $331.56.
Pass the AGI and payment_rate=0.15.
idr_monthly_payment(50000, payment_rate=0.15)Pass the AGI and payment_rate = 0.15.
idr_monthly_payment(50000, payment_rate = 0.15)6.3 Level 3: Challenge
max() only works on one income at a time. Find the IBR payment for three incomes at once: $20,000, $35,000, and $50,000.
Put the incomes in A2:A4 and fill the formula down.
The same formula in B2, filled down, returns $0.00, $96.04, and $221.04. Below $23,475 the payment is $0.
A list comprehension runs the function once per item: [idr_monthly_payment(a) for a in agis].
agis = [20000, 35000, 50000]
[idr_monthly_payment(a) for a in agis]sapply(agis, idr_monthly_payment) runs the function once per income.
agis <- c(20000, 35000, 50000)
sapply(agis, idr_monthly_payment)7 Debt to Income Ratio (DTI)
Lenders calculate this about you. Calculate it yourself first.
Formula: DTI = (Total Monthly Debt Payments ÷ Gross Monthly Income) × 100
Example: $2,500 in debt payments on $7,000 gross income is about 36% DTI.
Benchmarks: below 20% healthy; 20 to 35% manageable; 36 to 43% stretched; above 43% danger zone (most mortgage lenders say no).
DTI uses gross pay (before taxes), so it looks smaller than how it feels. At about 36%, this borrower sits right on the line between manageable and stretched. Paying off one $400 car payment would bring them to about 30%.
7.1 Level 1: Guided
Fill in the blanks to finish dti_ratio(), then find the DTI for $2,500 of debt payments on $7,000 gross monthly income.
Put the payments in A2 (2500) and gross income in B2 (7000). Find the DTI in C2.
=A2 / B2 * 100This returns 35.7.
Debt payments divided by gross income.
def dti_ratio(monthly_debt_payments, gross_monthly_income):
return (monthly_debt_payments / gross_monthly_income) * 100
dti_ratio(2500, 7000)Debt payments divided by gross income.
dti_ratio <- function(monthly_debt_payments, gross_monthly_income) {
(monthly_debt_payments / gross_monthly_income) * 100
}
dti_ratio(2500, 7000)7.2 Level 2: Practice
Lenders like a DTI of 36% or less. On $7,000 of gross monthly income, what is the most you can pay toward debts and stay there?
Find the ceiling in one formula.
=7000 * 36%This returns $2,520.
Flip the formula: payments = DTI × income. Write 36% as 0.36.
gross = 7000
gross * 0.36Flip the formula: payments = DTI × income. Write 36% as 0.36.
gross <- 7000
gross * 0.367.3 Level 3: Challenge
Five borrowers each earn $7,000 a month, with debt payments of $1,000, $1,750, $2,500, $2,800, and $3,200. How many are at 36% DTI or higher?
Put the payments in A2:A6, the DTI in B2:B6, and count.
In B2, filled down: =A2/7000*100. Then:
=COUNTIF(B2:B6, ">=36")The answer is 2 (40% and 45.7%).
borrowers["dti"] = dti_ratio(borrowers["debt_payments"], 7000), then (borrowers["dti"] >= 36).sum().
borrowers["dti"] = dti_ratio(borrowers["debt_payments"], 7000)
(borrowers["dti"] >= 36).sum()mutate(dti = dti_ratio(debt_payments, 7000)), then filter(dti >= 36) and nrow().
borrowers |>
mutate(dti = dti_ratio(debt_payments, 7000)) |>
filter(dti >= 36) |>
nrow()8 Pay Off vs. Invest Comparison
Should extra money go to the loan or to investments? Compare the two rates.
Formula: Yearly edge of investing = Expected after tax investment return − After tax loan interest rate
A positive answer favors investing. A negative answer favors paying off the debt.
Example: a 5% mortgage vs. an expected 7% return. 7% − 5% = 2%, so the math favors investing by about 2% a year. But the 5% is guaranteed and the 7% is not.
A 2% edge sounds small, but it compounds. On $10,000 over 10 years, it is the gap between about $16,300 (the guaranteed path) and about $19,700 (the expected path). The book’s rule of thumb also adds a middle zone: between 4% and 6%, do both.
8.1 Level 1: Guided
Fill in the blanks to finish payoff_vs_invest(), then compare a 5% mortgage with an expected 7% return.
Put the loan rate in A2 (0.05) and the expected return in B2 (0.07). Write the decision in C2.
=IF(A2 > B2, "Pay off the debt", IF(A2 < B2, "Invest the difference", "Roughly a wash; do both"))If the loan costs more than investing earns, pay it off. Otherwise invest. Use the labels “Pay off the debt” and “Invest the difference”.
def payoff_vs_invest(loan_rate, expected_return):
if loan_rate > expected_return:
return "Pay off the debt"
elif loan_rate < expected_return:
return "Invest the difference"
return "Roughly a wash; do both"
payoff_vs_invest(0.05, 0.07)If the loan costs more than investing earns, pay it off. Otherwise invest. Use the labels “Pay off the debt” and “Invest the difference”.
payoff_vs_invest <- function(loan_rate, expected_return) {
if (loan_rate > expected_return) {
"Pay off the debt"
} else if (loan_rate < expected_return) {
"Invest the difference"
} else {
"Roughly a wash; do both"
}
}
payoff_vs_invest(0.05, 0.07)8.2 Level 2: Practice
Put a number on that 2% edge. You have $10,000. After 10 years, how much more do you have by investing at 7% than by paying down the 5% mortgage (which “earns” 5%)?
Find the difference in one formula.
=10000*1.07^10 - 10000*1.05^10This returns $3,382.57.
Paying off the mortgage grows like an investment at the loan rate, 5%.
invest = 10000 * (1 + 0.07) ** 10
payoff = 10000 * (1 + 0.05) ** 10
invest - payoffPaying off the mortgage grows like an investment at the loan rate, 5%.
invest <- 10000 * (1 + 0.07)^10
payoff <- 10000 * (1 + 0.05)^10
invest - payoff8.3 Level 3: Challenge
The book’s rule of thumb: above 6% pay it off, 4% to 6% do both, below 4% invest. Write book_rule(loan_rate) that returns “Pay off”, “Do both”, or “Invest”, and apply it to loans at 3%, 5%, and 7%.
With rates in A2:A4, write the rule in B2 and fill down.
=IF(A2 > 6%, "Pay off", IF(A2 >= 4%, "Do both", "Invest"))Use if loan_rate > 0.06:, then elif loan_rate >= 0.04:, then the rest.
def book_rule(loan_rate):
if loan_rate > 0.06:
return "Pay off"
elif loan_rate >= 0.04:
return "Do both"
return "Invest"
[book_rule(r) for r in [0.03, 0.05, 0.07]]case_when() handles a whole vector: loan_rate > 0.06 ~ "Pay off", then loan_rate >= 0.04 ~ "Do both", then .default = "Invest".
book_rule <- function(loan_rate) {
case_when(
loan_rate > 0.06 ~ "Pay off",
loan_rate >= 0.04 ~ "Do both",
.default = "Invest"
)
}
book_rule(c(0.03, 0.05, 0.07))9 Avalanche vs. Snowball Math
Two ways to order several debts. Avalanche pays the highest APR first and saves the most. Snowball pays the smallest balance first and builds momentum.
Formula: Monthly interest saved by an extra payment = Extra payment × APR ÷ 12
Example: an extra $100 on Card B (24%) saves $2.00 of interest next month. The same $100 on Card A (18%) saves $1.50.
The book says to find the cost of snowball with a payoff calculator. The extra code below is a small one. It pays every minimum, sends the rest of a fixed monthly budget to the target debt, and rolls each freed up payment onto the next debt. The difference in total interest is the price of the snowball’s quick early wins. With these three cards, snowball costs about $338 more and takes one extra month.
9.1 Level 1: Guided
The avalanche method pays the highest APR first. Fill in the blank to sort the three cards and return the name of the first target.
With names in A2:A4, balances in B2:B4, and APRs in C2:C4, find the card with the highest APR.
=INDEX(A2:A4, MATCH(MAX(C2:C4), C2:C4, 0))This returns Card B (24%).
Sort by the "apr" column, highest first.
debts.sort_values("apr", ascending=False).iloc[0]["name"]Sort by the apr column, highest first.
debts |>
arrange(desc(apr)) |>
slice(1) |>
pull(name)9.2 Level 2: Practice
The snowball method pays the smallest balance first for a quick win. Which card is the first snowball target?
Find the card with the smallest balance.
=INDEX(A2:A4, MATCH(MIN(B2:B4), B2:B4, 0))This returns Card A ($1,000).
Sort by "balance", smallest first (the default), and take the first name.
debts.sort_values("balance").iloc[0]["name"]arrange(balance) sorts smallest first. Then slice(1) and pull(name).
debts |>
arrange(balance) |>
slice(1) |>
pull(name)9.3 Level 3: Challenge
payoff_sim() pays the minimums ($25, $100, $40) and sends the rest of a $400 monthly budget to the first card in order. It returns the months and total interest. How much more interest does the snowball cost than the avalanche?
This one needs a month-by-month table. Build columns for each card’s balance, interest, and payment for 26 rows, or skip to the Python or R tab.
The avalanche pays $1,782.34 of interest over 25 months and the snowball $2,120.62 over 26, so the snowball costs $338.28 more.
Pass order_snowball as the third argument. Each result is a dict, so use ["interest"].
avalanche = payoff_sim(debts, 400, order_avalanche)
snowball = payoff_sim(debts, 400, order_snowball)
snowball["interest"] - avalanche["interest"]Pass order_snowball as the third argument. Each result is a named vector, so use ["interest"].
avalanche <- payoff_sim(debts, 400, order_avalanche)
snowball <- payoff_sim(debts, 400, order_snowball)
snowball["interest"] - avalanche["interest"]10 Credit Utilization Ratio
How much of your available credit you are using. High use signals stress to credit scoring models.
Formula: Utilization = (Current Balance ÷ Credit Limit) × 100
Keep it under 30% on each card and across all cards. Under 10% is ideal.
Example: a $3,000 balance on a $10,000 limit is 30% utilization, right at the threshold.
Check each card and the total. A low total can hide one maxed out card. Closing an old card lowers your total limit, so the same balance shows a higher utilization.
10.1 Level 1: Guided
Fill in the blanks to finish credit_utilization(), then find the utilization of a $3,000 balance on a $10,000 limit.
Put the balance in A2 (3000) and the limit in B2 (10000). Find utilization in C2.
=A2 / B2 * 100This returns 30, right at the threshold.
Balance divided by limit.
def credit_utilization(balance, credit_limit):
return (balance / credit_limit) * 100
credit_utilization(3000, 10000)Balance divided by limit.
credit_utilization <- function(balance, credit_limit) {
(balance / credit_limit) * 100
}
credit_utilization(3000, 10000)10.2 Level 2: Practice
Three cards: Card A $300 of $5,000, Card B $2,700 of $3,000, and Card C $0 of $7,000. What is the overall utilization?
With balances in B2:B4 and limits in C2:C4, find the overall utilization.
=SUM(B2:B4) / SUM(C2:C4) * 100This returns 20, even though Card B alone is at 90%.
Add up the balance column and the limit column first.
credit_utilization(cards["balance"].sum(), cards["limit"].sum())Add up the balance column and the limit column first.
cards |>
summarise(overall = credit_utilization(sum(balance), sum(limit))) |>
pull(overall)10.3 Level 3: Challenge
You never use Card C, so you’re tempted to close it. What would your overall utilization be without its $7,000 limit?
Find the overall utilization using only Cards A and B.
=SUM(B2:B4) / SUM(C2:C3) * 100This returns 37.5, over the 30% line. Closing an unused card can hurt your score.
Keep the other rows with cards[cards["card"] != "Card C"], then total balances and limits.
open_cards = cards[cards["card"] != "Card C"]
credit_utilization(open_cards["balance"].sum(), open_cards["limit"].sum())filter(card != "Card C"), then summarise() with the sums.
cards |>
filter(card != "Card C") |>
summarise(overall = credit_utilization(sum(balance), sum(limit))) |>
pull(overall)
















