Rounding, SUMPRODUCT and Loan Payments
Round correctly with ROUND, ROUNDUP and MROUND, use INT and MOD, build weighted averages with SUMPRODUCT and calculate payments with PMT.
Welcome back!
Step 1 of 11Learn
The invoice that was off by a cent
An accounting team sends an invoice with three lines: $10.004, $10.004 and $10.004, calculated from unit prices with many decimals. Formatted to two decimal places, each line shows $10.00, but the total shows $30.01. The customer asks, reasonably, how three lines of $10.00 add up to $30.01.
The cause is the difference between formatting and rounding. Number formatting changes what a cell displays; the full value, 10.004, is still stored and used in every calculation. The total is 30.012, which displays as 30.01.
The fix is to round the values themselves where the business rule says they're rounded, usually at line level: =ROUND(B2*C2, 2). Now each line is 10.00, and the total is 30.00.
This matters beyond invoices. Payroll, tax, currency conversion and anything that's later matched against another system need to round at the same point the other system does. Decide where rounding happens, do it with a function, and never rely on the number format to do it.
Step 2 of 11Learn
The rounding family
ROUND(number, num_digits) rounds to the given number of decimal places. Halves round away from zero: =ROUND(2.5,0) is 3 and =ROUND(-2.5,0) is −3.
The num_digits argument can be negative, which rounds to the left of the decimal point: =ROUND(1234.567,1) is 1234.6, =ROUND(1234.567,0) is 1235, and =ROUND(1234.567,-2) is 1200. Negative digits are handy for budget summaries in hundreds or thousands.
ROUNDUP and ROUNDDOWN always move away from or toward zero: =ROUNDUP(3.01,0) is 4, and =ROUNDDOWN(3.99,0) is 3. Use ROUNDUP whenever a fraction means needing one more of something: boxes, buses, staff shifts.
MROUND(number, multiple) rounds to the nearest multiple: =MROUND(17,5) is 15, =MROUND(18,5) is 20. Prices to the nearest $0.05: =MROUND(B2,0.05). CEILING.MATH and FLOOR.MATH always round up or down to a multiple: =CEILING.MATH(17,5) is 20.
Two look-alikes: INT rounds down to the next lower integer, while TRUNC simply chops off decimals. They agree for positive numbers but not for negatives: =INT(-3.5) is −4, =TRUNC(-3.5) is −3.
Step 3 of 11Practice · Work it out
What does =ROUND(48650.75,-3) return?
Step 4 of 11Learn
INT and MOD: whole units and leftovers
Many business questions are division questions with two answers: how many whole units, and what's left over.
A warehouse needs to ship 1,000 phone cases, 48 to a box.
- Full boxes:
=INT(1000/48)returns 20. - Cases left over:
=MOD(1000,48)returns 40, because 20 × 48 = 960 and 1,000 − 960 = 40. - Boxes needed in total:
=ROUNDUP(1000/48,0)returns 21.
MOD(number, divisor) returns the remainder after division. Beyond leftovers, it has a few classic uses:
- Every nth row:
=MOD(ROW(),2)=0is TRUE on even rows, the basis of banded-row conditional formatting. - Even or odd:
=IF(MOD(A2,2)=0,"Even","Odd"). - Time past midnight: Excel stores times as fractions of a day, so a shift from 10:00 PM to 6:00 AM gives a negative difference.
=MOD(end-start,1)wraps it correctly to 8 hours.
A mistake to avoid is using ROUND where you need INT or ROUNDUP: =ROUND(1000/48,0) gives 21 here by luck, but for 1,000/52 = 19.2 it gives 19 boxes, leaving 12 cases with nowhere to go.
Step 5 of 11Practice · Work it out
A school needs to move 230 students on buses that hold 52 each. How many students ride on the last, partly filled bus? (This is =MOD(230,52).)
Step 6 of 11Learn
SUMPRODUCT: multiply, then add
SUMPRODUCT multiplies matching items in two or more ranges and adds up the results:
=SUMPRODUCT(B2:B4, C2:C4) = B2×C2 + B3×C3 + B4×C4
Its most common job is a weighted average. A course grade is 20% homework, 30% midterm and 50% final. A student scored 92, 78 and 85. With weights in B2:B4 and scores in C2:C4:
=SUMPRODUCT(B2:B4, C2:C4) = 0.2×92 + 0.3×78 + 0.5×85 = 18.4 + 23.4 + 42.5 = 84.3
The simple average, =AVERAGE(C2:C4), gives 85, which overweights homework. If the weights don't add up to 1 (for example, credit hours of 3, 4 and 2), divide by their sum: =SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4).
SUMPRODUCT can also apply conditions, using the TRUE = 1 trick from the first lesson: =SUMPRODUCT((B2:B7="West")*D2:D7) totals West amounts. SUMIFS is clearer for that, but SUMPRODUCT handles conditions SUMIFS can't, such as =SUMPRODUCT((MONTH(A2:A500)=3)*D2:D500) for March sales across all years.
Step 7 of 11Try the calculator
Weighted average calculator
Change the weights and scores to see how much each component moves the final grade. Weights are percentages and should add up to 100.
- Weighted average (SUMPRODUCT / SUM of weights)
- 84.3
- Simple average (AVERAGE)
- 85
- Total of weights
- 100 %
Step 8 of 11Learn
PMT: the monthly payment on a loan
PMT calculates the fixed payment that pays off a loan over a set number of periods:
=PMT(rate, nper, pv, [fv], [type])
rate: interest rate per periodnper: total number of paymentspv: present value, the amount borrowed
For a $20,000 car loan at 5% a year over 5 years with monthly payments:
=PMT(5%/12, 5*12, 20000) returns −$377.42.
Three details cause almost every PMT mistake. First, match the period: monthly payments need the annual rate divided by 12 and the years multiplied by 12. Using 5% with 60 periods calculates a loan at 5% per month. Second, the sign: Excel's financial functions treat money you receive as positive and money you pay as negative, so the payment comes back negative. Write =-PMT(...) or enter the loan as -20000 to show a positive payment. Third, the rate must be a decimal or percent: 5 means 500%.
The math behind it is P × r / (1 − (1 + r)^−n), where r is the periodic rate and n the number of payments. Multiply the payment by n to see total cost: 377.42 × 60 = $22,645, so about $2,645 is interest.
Step 9 of 11Try the calculator
Loan payment calculator (same math as PMT)
Try a longer term and watch the monthly payment fall while total interest climbs.
- Monthly payment
- 377.42 $
- Total paid
- 22,645 $
- Total interest
- 2,645 $
Step 10 of 11Practice · Choose one
A $15,000 loan at 6% per year is repaid monthly over 4 years. Which formula returns the payment as a positive number?
Step 11 of 11Practice · True or false
Formatting a cell to show two decimal places changes the value Excel uses in later calculations.
Lesson complete!