Sort in ascending order multiple rows (more than one rows), and copypaste it

egotajcs

New Member
Joined
May 6, 2017
Messages
27
Hi guys,

I like to solve my excel problems on my own, but sometime I stuck into a problem which I cannot solve.
I have a big database and I would like to sort prices in ascending order. But only inside for every four, five or six (or basically, any) rows. As I show it in the printscreen – and uploading the excel – I could do it for the first six-packed row. But I cannot copy-paste the formula downward for the pack (which is only 5 rows).
The date can be helpful to separate the packs.

I only hope I could tell you guys, what I would like to do.

I think, I should use arrays (CTRL-Shift-Enter), but that thing is over my brain sadly.

probe_Formula_for_ordering_some_rows.jpg

https://s11.postimg.org/pmok06ikz/probe_Formula_for_ordering_some_rows.jpg

Here it is my WIP excel file: https://anonfile.com/K5e9P4bbb4/results_probe_Formula_for_array_fav.xlsx
 
Last edited:
Sorry, you're absolutely right, it is rather confusing. The original goal to sort it out the price within the same times (so there are packs, each pack has some items with price) which item was the cheapest, which one was the second cheapest, which was the third cheapst, and so on.
And I started to try to solve it used 2 temporary column, which columns sorting out the prices and show the ascending order.

I show it in red text in this screenshot, I write column 'H' by hand: You know, the 'D' and 'E' columns are just helping to sorting the prices, originally I just want a fourth column after the date (col. 'A'), the No. (col. 'B') and price (col. 'C') which shows which one is the lowest, the second lowest, etc.

Here it is the excel file: https://anonfile.com/IaV6P9b5ba/results_probe_Formula_for_array_fav_GLITCH_WORKING.xlsx

what_was_the_goal.jpg


Let's see the raw 8-12: the first raw is 270, which is the third lowest price within the selling time: 3. The next one, which is 300, is the fourth: 4. 75 is the second lowest: 2. 60 is the lowest, cheapest item: 1. And 415 is the last one in this time range: 5.
So the H8:H12 is: 3, 4, 2, 1, 5.
 
Last edited:
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Oh...you want something much more simpler than what i was supposing.
You just need to rank the prices inside each group. So no need of any auxiliary column.

To get the results you have shown in red, try this regular formula in H2 copied down
=COUNTIFS(A$2:A$37,A2,C$2:C$37,"<"&C2)+COUNTIFS(A$2:A2,A2,C$2:C2,C2)
confirmed with just Enter

M.
 
Last edited:
Upvote 0
Thank you, Marcelo.
It means, I was stupid in the thread's opening post I didn't clarify, what is the main goal I would like to achieve, and I misleaded everybody.

Anyway, thank you so much, this is it!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top