How to Round and Sort Data using Excel Formulas?

Share

Facebook
Twitter
LinkedIn

Cheryl asks via e-mail,

I was wondering if you could help me figure out how to combine the round formula with the rank formula? I need to first round all the numbers and then rank them. I have tried various ways to do this but they aren’t working properly. I really don’t want to add a column to round and then rank because I need to do this round/rank many times for this particular spreadsheet. There are also merged columns which makes it even more challenging. Before I go through the painstaking efforts to insert columns to round, I thought I’d check with you.

round-and-sort-using-excel-array-formulas
Of course, just as any other excel formula problem, we can solve this with … strong coffee.

Well, I am kidding, but coffee along with array formulas seems to help.

How to write an excel array formula to round and sort a list?

Assuming the data is in range C3:C12, and B3:B12 has running numbers from 1 to 10, the below array formula,

=SMALL(ROUNDDOWN(C3:C12,0),B3:B12)

when entered in the range D3:D12 will round and sort the range of values in C3:C12.

Remember, first you should select the entire range D3:D12 and then type the formula (in first cell) and press ctrl + shift + enter to make it an array formula.

Update: Even better alternatives from commenters

Here are few interesting alternatives, thanks to our commeneters.

  • =SMALL(ROUNDDOWN($B$1:$B$9,0),ROW(B1)), array enter in cell C1 and drag in the entire range. Thanks to Chrisham.
  • Instead of using ROW() as Chrisham did above, we can also use ROWS() function. This will let you add rows on top without having to change formulas. Elias recommends using this formula: =SMALL(INDEX(INT($C$3:$C$12),0),ROWS($D$3:D3)). Thank you.
  • Since we are only sorting numbers, it shouldn’t matter whether we sort and round or round and sort, as Jeff pointed. So, we can use the normal formula =ROUNDDOWN(SMALL($B$3:$B$12,ROWS(B$3:B3)),0) in cell C3 and copy in the entire range. Thanks Jeff

More resources: Learn excel array formulas | Online Help on Excel Formulas

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

8 Responses to “Create a Combination Chart, Add Secondary Axis in Excel [15 Second Tutorial]”

  1. [...] Select the “daily completed” column and add it to the burn down chart. Once added, change the chart type for this series to bar chart (read how you can combine 2 different chart types in one) [...]

  2. [...] set the height series to be plotted on secondary axis. Learn more about combining 2 chart types and adding secondary axis in [...]

  3. [...] To show the years, I have used another dummy series and plotted it on secondary axis (related: how to add secondary axis?) [...]

  4. Thanks for this one!

  5. [...] Choisissez la colonne « Daily Completed » et ajoutez-la au graphique. Une fois ajoutée, changez le type de graphique pour cette série à histogramme (lisez comment combiner 2 types de graphiques en un : combine 2 different chart types in one) [...]

  6. Nat says:

    How do i create a chart that has negative numbers on axis x and y and plot them correctly? I cannot seem to understand how to do this, please help.
    Thanks.

    Nat

  7. MSWebReviewer says:

    You can also plot 2 or more Y axes in Excel using EZplot or Multy_Y from Office Expander.com
    There is a demo version to try.
    Cheers.

Leave a Reply