Sort by Column

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
Use a Helper column.

in a blank column say column I

in I1
=A1+0.1

in I2
=IF(A2="",C1+0.1,A2+0.1)
and copy this formula only down the column and include one more row which will be blank (so that all data consist of 3 rows - even a blank row)

Now sort on Column I.
 
Last edited:

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
in I3 and subsequent rows copy I2.
Copy as far as there is data in column B and one more row.
This ensures that all the data consist of three rows - two with data and one blank row, otherwise when you sort it doesnt produce a blank row on one row of data.
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
Sorry, my fault, the formula needs adjusting, i was testing in column A.

in a blank column say column I

Start your data in row 2

in I2
=IF(C2="",I1+0.1,C2+0.1)
and copy this formula only down the column and include one more row which will be blank (so that all data consist of 3 rows - even a blank row)

Now sort on Column I.
 

emvella

New Member
Joined
Apr 7, 2017
Messages
46

ADVERTISEMENT

Hi Special-K99, it is not working.

Can I send you an excel sheet?
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
Sure, I dont know if you can send an attachment using PM.
Might be easier to upload to an online storage site and then provide the link to it.
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
Aarrrgh! You've changed the data again.
In Post #5 the times are in column C, now they're in column B!! Grrr!!

Ok.

Insert a row so the data starts in row 2.

in H2
=IF(B2="",H1+0.1,TEXT(B2,"hhmm")*100+0.1)
copy this formula down as far as row 16 (the Blank row - this ensures each data entry has THREE lines (5*3=15) + the blank row at the top = 16)

Now select columns B:H and sort on column H

The times are now in order and each accompany row has been sorted with its original "parent" time.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,362
Messages
5,528,258
Members
409,811
Latest member
pjwhyman

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top