3.5 ROUND Family and RANK
Choose a rule before changing a number
A fictional Blinkit-inspired worksheet shows three service fees as ₹10.13 each. The displayed grand total is ₹30.38. A teammate adds the three visible amounts and gets ₹30.39. Both numbers have a clear explanation. One formula keeps the raw value of each line until the end. The other rounds each line before adding it.
This lesson uses made-up amounts, inventory counts and review scores. The examples describe Excel practice policies. They make no claim about Blinkit's or Amazon's actual commercial processes. You will use one worksheet to prove where the one-paise difference comes from and another to see how ranking reacts to genuinely equal values.
Separate appearance, value and policy
- Appearance. Number formats can show two decimal places and a currency symbol. In the normal workbook precision mode, this changes what you see. Other formulas can still read the finer value underneath.
- Value. A rounding function returns a new numeric value. If that result is referenced by a later formula, the later formula reads the rounded value.
- Policy. A business rule decides when to round and in which direction. A report can choose to round its final display. An exercise that requires every charge line to be computed to paise needs the rounded line values themselves.
The second half of the lesson asks a different question. A rank describes a value's position relative to other numeric values in a chosen group. If scores should be ranked high to low, the largest gets rank one. If times should be ranked fast to slow, the smallest gives rank one. Look at the data and the intended ranking direction before you write that argument.
Control the decimal place and direction
ROUND(number, num_digits) rounds to the nearest value at the selected place. A positive number of digits rounds to the right of the decimal point. Zero rounds to a whole number. A negative number of digits rounds to a place to the left, such as tens or hundreds. A negative setting is about place, so it can also be used on a positive input.
| Expression | Expected value | Decision |
|---|---|---|
=ROUND(10.125,2) | 10.13 | Round to hundredths. This value is halfway between two choices. |
=ROUND(-10.125,2) | -10.13 | Round the halfway case away from zero. |
=ROUND(12.375,1) | 12.4 | Round to the nearest tenth. |
=ROUND(12.375,0) | 12 | Round to the nearest whole number. |
=ROUND(146,-1) | 150 | Round to the nearest ten. |
=ROUND(144,-1) | 140 | The neighboring ten on the other side is closer. |
=ROUND(-145,-1) | -150 | This negative midpoint rounds away from zero. |
Think “away from zero” and “toward zero”
With ROUNDUP, movement is away from zero whenever discarded digits require movement. With ROUNDDOWN, movement is toward zero when digits are discarded. For positive inputs, ROUNDUP is the larger result. For negative inputs, it is more negative. =ROUNDUP(-10.125,2) produces -10.13. =ROUNDDOWN(-10.125,2) gives -10.12. The names are easier to remember by picturing both sides of zero.
When you need a whole number, compare =TRUNC(-4.3) and =INT(-4.3). TRUNC cuts off the fractional part and gives -4. INT gives the lower integer, -5. Both give four for positive 4.3. Testing only positive values would miss the difference. If a credit, refund or adjustment may be negative, put a negative row in your test fixture.
Keep the normal workbook precision setting for the exercise
Most formatting changes leave the value available to later calculations. Excel also offers a workbook option to use the displayed precision. That option changes stored values and can permanently affect calculations. For the labs here, keep the usual full-precision mode and use explicit rounding functions where the exercise calls for them. This lets you inspect the original raw values and compare the two predicted totals.
Round to a pack or step that has business meaning
Counting decimal places does not express every rule. An inventory count can require a multiple of ten because a case holds ten units. A fictional display price can follow increments of five rupees. Decide whether the result should be the nearest multiple or a directional multiple. That distinction answers whether it may fall on either side of the starting number.
- MROUND finds the nearest multiple.
=MROUND(47,5)produces 45, since 47 is closer to 45 than to 50.=MROUND(48,5)produces 50. The same increment can produce results in either direction. - CEILING.MATH can round a positive value up to the next allowed multiple.
=CEILING.MATH(47,10)produces 50, enough capacity for 47 units when cases hold ten. The upward rule matters more than the closest distance in this scenario. - FLOOR.MATH can round a positive value down to the previous allowed multiple.
=FLOOR.MATH(47,10)produces 40. That represents units packed into full cases only, leaving seven loose units.
Check the rule when values can be negative
The default negative directions for these two functions differ. =CEILING.MATH(-13,5) gives -10, toward zero. =FLOOR.MATH(-13,5) gives -15, away from zero. Set the optional mode argument to -1 in these examples and the negative direction reverses. The examples become -15 for CEILING.MATH and -10 for FLOOR.MATH. Give a negative example its own expected output so the signs do not get lost in the report.
For MROUND on a negative input, use a multiple with the same sign. =MROUND(-13,-5) gives -15. Opposite signs, such as in =MROUND(-13,5), give a number error. Microsoft also documents a midpoint limitation for decimal multiples: ostensibly similar halfway cases can round in different directions. Use well-defined, tested values for the exercise and check important decimal midpoint rules explicitly in real work.
For a simple whole-number midpoint, try forty-five as an input with a multiple of ten. It is exactly the same distance from forty and fifty. MROUND chooses fifty. This one fixture checks the halfway choice separately from a value like forty-seven, which is closer to fifty already. Decimal multiples have the documented limitation above, so keep their test cases separate from this integer one.
Lab 1 · Reconcile the one-paise difference
Create a scratch tab named Fees. Put Order ID in A1, Raw fee in B1 and Rounded fee in C1. Enter three unique practice IDs in A2:A4 and type 10.125 in each of B2:B4. These values have an extra decimal place on purpose. Keep the original entries available until the comparison is finished.
Prove the stored values before formatting
- Use enough decimal places to see 10.125 in each source cell. In a spare cell, use
=SUM(B2:B4). It returns 30.375. The total uses the full raw fee from each row. - Show the raw fees and their sum using two decimal places. The three raw fee displays read 10.13, and the sum display reads 30.38 under normal precision. Select a source fee and inspect the formula bar. The source entry is still 10.125.
- In C2 enter
=ROUND(B2,2)and fill through C4. Check all three results as 10.13. These are returned values at hundredth precision, so a sum of the C results uses the rounded values. - Use
=SUM(C2:C4)for the per-line method. It returns 30.39. Use=ROUND(SUM(B2:B4),2)for the final-total method. It returns 30.38. The raw tab can still show one or both methods for auditing purposes.
Trace what a later formula reads
Read one raw line
The fee is stored as 10.125. A display with two decimals shows 10.13. The raw value feeding SUM stays at 10.125 under normal precision.
Use a rounded helper
ROUND on each fee gives 10.13 as the returned value. A formula summing those helpers reads three returned amounts of 10.13.
Add the rounded lines
The three rounded lines give ₹30.39. This is appropriate when the practice rule says each individual charge uses two decimals before summing.
Round the raw sum instead
The sum of raw fees is ₹30.375. Rounding that value once gives ₹30.38. It is the result when the practice rule preserves raw amounts until the final total.
Test when the totals agree
In the practice copy, change B4 to 10.12. The first two rounded lines stay at 10.13 and the third reads 10.12, giving a rounded-line total of 30.38. Add the raw values separately: 10.125 plus 10.125 is 20.25, and 20.25 plus 10.12 is 30.37. The two totals still differ by 0.01. The difference depends on the unrounded part of each contributing amount.
For a version where they agree, change B2 and B3 to 10.12 as well. All three entries now already have just two decimal places. Both methods return 30.36. Restore the original three raw inputs after comparing these cases. Matching results on inputs already rounded cannot prove that the two policies will always agree on a rougher source.
Read rank relative to a comparison group
When you ask for rank, the comparison group matters as much as the individual value. In =RANK.EQ(C2,$C$2:$C$6,0), C2 supplies the value to rank, the fixed C2 through C6 range contains the other comparison values, and 0 sets descending order. Descending means largest first. You can omit the last argument for that behavior. Use 1 in this lesson when the smallest value should get rank one. Excel accepts a nonzero order for ascending ranking.
The result is a numeric rank in the current row. The function does not rearrange the original rows. This is useful when an identifier must stay aligned with its score and several kinds of ranks should be visible alongside it. Sort a copy of the score population if you need to inspect the actual order or prove which positions a tie occupies.
Decide how tied records share places
- RANK.EQ. Equal values receive the same first rank from the positions they occupy together. With scores 98, 91, 91, 84 and 76 in descending order, the two 91s share rank two. The next score is the fourth observation and gets rank four.
- RANK.AVG. The equal scores receive the arithmetic mean of their positions. Positions two and three average to 2.5, so each of the two 91s gets 2.5. The next observation still occupies position four.
- A single winner among ties. A different policy might use another field such as a submission timestamp to choose one record. Equal-score rank by itself does not apply that tie-breaking rule. Write the policy before choosing a formula.
Lab 2 · Compare score rank, time rank and ties
Make a new worksheet named StoreRank. Enter the fictional practice group below. The store codes and their figures are invented. Columns B and C answer different questions. You want a smaller duration to rank ahead of a larger one, and a higher quality score to rank ahead of a lower one.
| A Store | B Minutes | C Score | D Score EQ | E Score AVG | F Time EQ |
|---|---|---|---|---|---|
| North | 12 | 98 | 1 | 1 | 3 |
| East | 9 | 91 | 2 | 2.5 | 1 |
| West | 9 | 91 | 2 | 2.5 | 1 |
| South | 14 | 84 | 4 | 4 | 4 |
| Central | 18 | 76 | 5 | 5 | 5 |
Write the first formulas and inspect the last row
- In D2 enter
=RANK.EQ(C2,$C$2:$C$6,0). In E2 enter=RANK.AVG(C2,$C$2:$C$6,0). Keep the numeric comparison range fixed across all rows. The item being ranked uses a relative address so it moves with the store. - In F2 enter
=RANK.EQ(B2,$B$2:$B$6,1). A time of nine gets rank one because no observation is faster. North's twelve minutes come after both nine-minute records and get rank three. - Fill D2 through F2 down to row 6. Select D6 and verify the formula ranks C6 within the original C2 through C6 set. Confirm the five result rows against the table. If the group shifted with the item, locate the missing dollar signs.
- Temporarily change C4 from 91 to 92. North remains first, West becomes second and East moves to third in both score ranks. There is no tie. The time ranks stay the same. Restore 91 and verify that the tie returns.
Create displays that look tied before the underlying values tie
Change C3 to 91.125 and C4 to 91.0625 in a practice copy. Format both cells to show one decimal place. Both show 91.1. Use the formula bar to confirm that they retain different underlying values. Ranking the raw score still puts East before West. Their score ranks are two and three because 91.125 is greater than 91.0625.
Now put Score rounded to one decimal in G1 and =ROUND(C2,1) in G2. Fill it down. G3 and G4 now both have the same numeric result of 91.1. In H2 rank G2 across $G$2:$G$6 with RANK.EQ and fill it down. The two rows now both rank second under this deliberately different competition policy. A later formula can read the helper using the rounded value. Restore the raw sample or keep the variation in a clearly named copy.
Verify a rank without moving the sheet around
Read the comparison group before interpreting a rank. In the original chapter Orders sheet, =RANK.EQ(G3,$G$2:$G$11) ranks the ₹270 amount against all ten amounts. Its rank is two because the only greater amount is ₹1,299. =RANK.EQ(H7,$H$2:$H$11,1) ranks the eight-minute observation first in ascending order. The two formulas use different value fields and different meanings for first place.
Use “how many ahead?” as a check
In a descending RANK.EQ, count how many numeric values are larger and add one. With the original scores, one value exceeds 91. Each 91 therefore gets rank two. Two values equal 91, so the two occupied positions are two and three. Averaging these positions explains RANK.AVG. Four positions come before the final 76 even though the displayed rank list skips number three.
In an ascending RANK.EQ, count smaller values and add one. With the minutes example, there are two smaller values ahead of twelve. The result is three. You can verify either rank with a sorted copy, a careful hand count, or a suitable COUNTIF on a clean numeric test fixture.
Filter or redefine the group when the comparison changes
If a teammate asks for rank among deliveries only, identify those records first. Simply filtering the sheet view does not change the range passed to the ordinary rank call in this lesson. If your comparison range still covers all statuses, its rank still uses them. In the workshop, you can filter, copy eligible numeric values into an explicitly labeled scratch list, and rank across that new group while keeping the associated IDs on the same rows. A rank can change even when the current order's own score or amount is unchanged.
- Check that all intended ranking values are numeric. The rank reference ignores nonnumeric entries. A visible number stored as text may be missing from the group you meant to compare.
- Use zero or omit the order argument for descending. For ascending results, use one consistently so another reader recognizes the setting.
- Decide whether top-two means every record at the top two ranks or exactly two chosen records. A tie at second can include three records in a top-two-ranks report. A fixed number of awards needs an explicit tie policy.
Extend the rounding test to capacity and precision
A marketplace seller's fictional stock report uses ten-piece cases. The expected input values are counts of individual physical units. Store 47 in B2 of a scratch sheet. Use =ROUNDUP(B2/10,0) to determine the number of cases needed to hold all items. It returns five because a partial case still uses a case. Use =CEILING.MATH(B2,10) to report unit capacity, 50. Divide that capacity by ten to recover the same case count.
Use =FLOOR.MATH(B2,10) to find the units already enough for complete cases, 40. Subtract it from 47 to get seven loose units. If the input becomes 50, capacity stays 50 and loose units fall to zero. If the input becomes 51, capacity becomes 60 and there is one loose unit. Check both sides of this boundary before reusing the formulas for larger values.
- For 47 units, verify that four full cases and one partly used case can hold the entire quantity. A rounding-to-nearest function alone cannot promise enough capacity.
- For zero units, both case count and capacity should be zero under this fictional rule. If your project requires an extra empty case, document that requirement as a separate quantity.
- For an already exact multiple such as fifty, the ceiling and floor give the same result. That one value does not test both policies well. Also test forty-seven and fifty-one.
Excel has limited numeric precision and uses binary floating-point values for numbers. Some decimals are approximated internally, which can make calculated values very close to a boundary. Use an explicit business rounding rule where needed and test cases around the threshold. The lab uses raw fees with a fractional part of one eighth, which Excel can represent exactly as a binary fraction. That makes it easier to see the intended difference between line and total policies without relying on near-ties.
Practice extension · rank within the eligible group
A fictional operations report now asks for each delivered order's amount rank. The original ten-order sheet includes a ₹240 cancelled order. It can make a delivered order look lower in an all-status comparison. This exercise preserves one score per original row so you can still see the order ID and status while reviewing the derived rank.
Establish the comparison on one known order
Find row 6, the ₹232 order with Delivered status. The amounts above it in the original sheet are ₹270, ₹240 and ₹1,299. Its overall rank is four. In the delivered population, the ₹240 order is outside the group. Only two delivered amounts are ahead of it, making it third among delivered orders. The row's own amount has not changed.
In an empty results column, use this practice calculation on the Orders sheet. It returns a numeric rank for the delivered rows and a text label for the other statuses. Read the IF as a scope check before the rank. For an eligible row, the calculation counts other delivered orders whose amount is greater, then adds one. The clean fixture gives all rows numeric amounts, which is important to the rank definition.
=IF(I2="Delivered",1+COUNTIFS($I$2:$I$11,"Delivered",$G$2:$G$11,">"&G2),"Outside group")
- Fill the expression down the ten order rows. The comparison populations in G and I stay fixed. The amount to compare with advances as the formula moves down.
- Check the highest delivered order at ₹1,299. The count of greater delivered amounts is zero, so it gets one. The ₹270 order gets two. A cancelled or returned row displays Outside group rather than a numeric rank.
- Check row 6 and confirm rank three. Compare it with a plain RANK.EQ over all ten rows, which returns four. The changed population is the intended reason for the difference.
- In a scratch copy, change G4 from 110 to 232. Row 4 and row 6 now have the same eligible amount. Each receives rank three. The next smaller delivered amount is ₹150, and it gets rank five because two observations share the positions that start at three. Restore G4 to 110 after the check.
This approach gives the same tie principle as RANK.EQ because only strictly larger values are counted before each row. If rounding is part of the ranking policy, compare the values from the rounded helper field in both references. If missing amounts are allowed, add a measurement-eligibility check so the comparison group and the individual item both obey the same rule.
Avoid misleading precision in a published worksheet
Use the unit to choose where to round
An amount in rupees rounded to two decimal places and a percentage rounded to two decimal places on screen are different choices. A stored rate of 0.123456 displays as 12.35% with a percentage format showing two decimal places. That display has two decimal places after the percent conversion. =ROUND(0.123456,2) returns 0.12, which displays as 12.00% at the same percentage format. If a fictional rule calls for rounding to a hundredth of a percentage point, apply a precision of four places to the fraction. It gives 0.1235, which displays as 12.35%.
Check numeric quantities for the same unit issue. Ten units per case and ten rupees per increment can both use a multiple of ten, but the outputs answer different questions. Name the result meaning as well as the increment. Someone reading “50” later should know whether it means a price, capacity or count of objects.
Avoid rounding the same number repeatedly
Consider a fictional practice average of 2.34765625 seconds. A result rounded directly to one decimal place is 2.3. Round it to two decimals first and it becomes 2.35. Rounding that intermediate value again to one decimal gives 2.4. The extra operation moved the intermediate to a new decision boundary. If your policy says round to one decimal only once, keep the source value available until that point.
- Write the precision and stage next to the formula. In the Fees exercise, a line amount and a document total may have different required stages.
- Verify with a value at the boundary and one immediately on each side. A spreadsheet using binary floating point approximates some decimal values. Know which values are inputs and which values were reached by earlier calculations.
- Inspect number formats when apparent ties or small discrepancies appear. Increase displayed decimals in a practice copy and check the formula bar. Compare raw values numerically when the decision truly uses them.
- Use an explicit rounded column when a policy applies to every row, and compare its result with a direct calculation in a small test. This preserves a readable source and a measurable difference if the two policies disagree.
Explain ranks alongside absolute differences
Rank tells you a position and leaves out the size of the gap. A score of 98 ranked first and 91 ranked second differ by seven points. If the scores changed to 92 and 91, the two positions could stay the same even though the gap became one point. Include both the measured value and the rank when a teammate needs to decide whether the difference matters.
Before showing several groups together, make the scale and calculation population visible. For example, a practice seller can define separate ranks by city when stores in different cities are not meant to form one leaderboard. A store may rank first locally and third in the combined report. This alone does not establish an improvement or a decline. Verify the group, its membership and its count.
- Write whether rank one means highest value or lowest value. In the two-column store lab, score and time intentionally use opposing directions.
- Write the tie method and the field used to calculate it. If you rank by a rounded helper, keep that result available to compare with the raw score. Two visible rounded values are insufficient evidence that the underlying ranking uses a tie.
- Record whether the group includes records outside the visible filter. If the intended scope is smaller than the address, build the appropriate reference or an explicit conditional calculation before presenting it.
Interpret a request for ranks without gaps
A league table might want to count distinct score levels, so the next different score always receives the next integer. This is often called dense ranking. The five practice scores would then receive 1, 2, 2, 3 and 4. Count the ordered score levels 98, 91, 84 and 76 to check it. By contrast, the ordinary equal-rank function counts observations that ranked ahead. RANK.AVG shares positions and also leaves the next score at position four. Pick dense ranking only when the report explicitly calls for positions among distinct values.
To prove the distinction by hand, put the four distinct score values on another scratch tab in descending order. Rank each of those four values and map the results back to the five unlumped source rows using the matching score. Both 91s point to the same rank. That gives a simple baseline when you later learn to create a distinct list automatically. Confirm whether a missing or error value should appear in that list before using it to assign ranks.
Check what a rounded report asks a reader to decide
A two-decimal sales report can communicate a rounded total without changing how raw transactions are ranked. A competition that awards a place on the basis of displayed scores needs a separate formal step: round the observed scores and rank those returned numbers. Test with the close-scoring East and West records. A user should be able to inspect which field a downstream award calculation used.
Write a short handoff note that states where your raw inputs are kept and which columns are derived. Note that rounding and ranking can be rebuilt from the raw values when a rule changes. If a previous version of the file overwrote the inputs with rounded results, you would need the original source to test fine differences. Keeping raw and derived values in separate fields leaves a reproducible path for a later review.
Quiz · choose a rounding or ranking rule
Three raw fees are 10.125 each. Which policy returns 30.39?
Round every fee to 10.13 before adding. Rounding the raw sum once gives 30.38. The difference is the stage when hundredth precision enters the calculation.
Which is further from zero for input -10.125, ROUNDUP or ROUNDDOWN to two digits?
ROUNDUP returns -10.13, further from zero. ROUNDDOWN returns -10.12, toward zero. The direction matters when a sheet includes negative values.
How many ten-unit cases do you need for 47 individual units?
Five cases, giving capacity for 50 units. Four complete cases hold 40 with seven items left over. The capacity calculation must use upward rounding, so a nearest-multiple result by itself is not sufficient.
What ranks do equal scores of 91 receive after 98?
They occupy positions two and three in the descending list. RANK.EQ gives both the earlier position, two. RANK.AVG gives both the mean of those positions, 2.5.
Two raw scores both display as 91.1. Do they necessarily share rank?
No. They can display the same value while storing different precision, as in the 91.125 and 91.0625 example. A rank using raw inputs sees the difference. A rank using rounded helper values can intentionally create the tie.
What direction makes the fastest duration rank one?
Ascending. Use 1 in the order argument so smaller durations appear first in the comparison. Check the group for ties before equating first place with one unique order.
Interview practice · show a test case
How can displayed line totals disagree with a displayed grand total?
Number formatting can show fewer decimal places while later formulas continue reading raw values. I would compare summing raw values and rounding at the end with rounding each line before summing. The practice fees return totals that differ by a paise under those two policies.
When would you choose CEILING.MATH instead of MROUND?
I would use the ceiling for positive capacity when the result must meet or exceed the required units. A nearest multiple could round below demand. I would test a value just under a case boundary and one just over it.
How do you make a ranking formula safe to copy down?
I would keep the comparison group fixed with absolute references and let the ranked item follow its row. I would verify the last filled formula and count the number of larger or smaller values for one independent check.
How would you explain a missing third rank?
Two records can share rank two and occupy positions two and three together. The next observation sits in position four. I would show the sorted values to demonstrate that no record has disappeared.
What would you check if a raw-score leaderboard disagreed with the displayed values?
I would inspect the raw score precision, the format and the formula's comparison range. A display tie may not be a numeric tie. If the policy uses rounded scores, I would rank a clearly named rounded result column and verify the expected tied records.
Six cards for a quick rule check
- Format Under normal precision, change appearance and keep the underlying numeric value available.
- ROUND Return a value at a chosen place. Positive digits are decimal places, zero is whole numbers, and negative digits are places to the left.
- Direction ROUNDUP moves away from zero and ROUNDDOWN toward it. Check a negative example.
- Increment Use a nearest multiple for a snap-to-step rule. Use a directional multiple if capacity or full-pack counts set a boundary.
- Rank group Rank one can mean highest or lowest. Keep the reference to the intended group fixed when filling down.
- Ties RANK.EQ returns the earlier shared position. RANK.AVG gives the average occupied position. Pick the raw or rounded ranking field deliberately.
Continue with text positions and extraction. Revisit the custom number formats lesson if you want to design a display while keeping the original value available.
Microsoft references
Continue practising: explore the existing Excel Task Hub for additional exercises.