Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Sorting and inserting problem

Hi All!
I have a set of data which i need to sort in a kind of complicated
way. The source data is in 2 columns and goes as follows:
1 2
1 2
1 3
1 3
1 4
1 5
1 5
2 1
2 1
3 1
4 1
4 1
4 1
etc..
what i need to get is:
1 2
1 2
2 1
2 1
1 3
1 3
3 1
1 4
4 1
4 1
4 1
1 5
etc..
In other words after each group of similiar data (i.e. 1 2) i should
put a group of inverse data (i.e. 2 1) . Have no idea where to start.
Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Sorting and inserting problem

Hi Vlad,
C1: =MIN(A1,B1) doubleclick on fill handle to copy down
Sort on C, A, B all ascending
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Vlad" wrote in message om...
Hi All!
I have a set of data which i need to sort in a kind of complicated
way. The source data is in 2 columns and goes as follows:
1 2
1 2
1 3
1 3
1 4
1 5
1 5
2 1
2 1
3 1
4 1
4 1
4 1
etc..
what i need to get is:
1 2
1 2
2 1
2 1
1 3
1 3
3 1
1 4
4 1
4 1
4 1
1 5
etc..
In other words after each group of similiar data (i.e. 1 2) i should
put a group of inverse data (i.e. 2 1) . Have no idea where to start.
Any help would be greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Sorting and inserting problem

I originally thought about the min function but all of the entries have a 1
in them so the sort does not work...

"Vlad" wrote:

Hi All!
I have a set of data which i need to sort in a kind of complicated
way. The source data is in 2 columns and goes as follows:
1 2
1 2
1 3
1 3
1 4
1 5
1 5
2 1
2 1
3 1
4 1
4 1
4 1
etc..
what i need to get is:
1 2
1 2
2 1
2 1
1 3
1 3
3 1
1 4
4 1
4 1
4 1
1 5
etc..
In other words after each group of similiar data (i.e. 1 2) i should
put a group of inverse data (i.e. 2 1) . Have no idea where to start.
Any help would be greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Sorting and inserting problem

What criteria do you use to know whether you have a
correct solution solution or not ?

The following will produce the order you indicate that you want.

C1: =MIN(A1,B1)
D1: =MAX(A1,B1)

fill down by double click on the fill handle
Sort C ascending, D ascending, A ascending

It would also work same if D1: =A1+B1

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Jim Thomlinson" wrote in message
...
I originally thought about the min function but all of the entries have a 1
in them so the sort does not work...

"Vlad" wrote:

Hi All!
I have a set of data which i need to sort in a kind of complicated
way. The source data is in 2 columns and goes as follows:
1 2
1 2
1 3
1 3
1 4
1 5
1 5
2 1
2 1
3 1
4 1
4 1
4 1
etc..
what i need to get is:
1 2
1 2
2 1
2 1
1 3
1 3
3 1
1 4
4 1
4 1
4 1
1 5
etc..
In other words after each group of similiar data (i.e. 1 2) i should
put a group of inverse data (i.e. 2 1) . Have no idea where to start.
Any help would be greatly appreciated.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Sorting and inserting problem

Thanks a lot everyone for their input, especially for the idea with
summation -that was simple, but really helpful.
Now i have another problem. I need to insert an empty row after each
group of data and calculate a sum for this group. Can anyone suggest
how can i do this in VBA, cause the the size of the data area is
changing with each inserted row, so i can't use a simple loop here..
TIA.

Justyaz wrote in message . ..
On Thu, 26 Aug 2004 03:59:47 -0600, Justyaz
wrote:

On 25 Aug 2004 10:15:43 -0700, (Vlad) wrote:

There is probably a better way to write this out but I'm still a
newbie.

C1:=IF(INT(VALUE(CONCATENATE(A1,B1))/10)=2,VALUE(CONCATENATE(A1,B1)/10+10),(VALUE(CONCATENATE(A1,B1))))

Sort on C Ascending.

Peace, Vm
Yaz

Providing complicated solutions to simple problems since 1997.


Ignore my suggestion. It doesn't work for number 10 and above.

Peace, Vm
Yaz

Providing complicated solutions to simple problems since 1997.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting dates and inserting rows Andy Excel Worksheet Functions 3 June 7th 08 03:12 PM
Automatic Sorting and Inserting Rows Andy Excel Discussion (Misc queries) 4 June 7th 08 01:26 PM
Column Inserting and sorting problem Kevin Excel Discussion (Misc queries) 3 July 26th 07 11:39 AM
Problem inserting a new worksheet Nick Excel Discussion (Misc queries) 4 November 17th 05 07:29 AM
Inserting pictures then sorting Dav Excel Discussion (Misc queries) 2 November 3rd 05 11:39 AM


All times are GMT +1. The time now is 07:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"