Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default repost: connect two rows of data

Hi All,
Here is my dilemma. A is name b:E data, F is sum of each row and every other
row I add the sums is F, so each name has a 2subtotal rows and one grand
total
I need to sort by the grand total but keep the two rows of data together.
Any tricks or tips ? All help is appreciated.
Smith 5 4 5 3 17
6 5 5 4 20 37
Jones 4 3 3 3 13
5 5 5 5 20 33
white 5 4 4 4 17
4 3 3 3 13 30
Pete 5 5 5 5 20
6 5 4 3 18 38


--
jeffP



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default repost: connect two rows of data

hi jeff,

I need to sort by the grand total but keep the two rows of data together.


add two columns (here x and y). in x1 you write

=a1&1
(where a1 shows "smith")
in x2 you write
=a1&2

in y1 you write:
=y2

in y2 you write:
=g2
where g2 shows the total of 37.

the result for x and y would be:

smith1 37
smith2 37

then you copy range (x1:y2) and paste it down the list, then you can sort
first by column y and then by x.

this will *only*work*if* ***all*** your records are using 2 lines.

arno



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default repost: connect two rows of data

Hi Arno,
Nice solution and a non programming one. Was surprised that the
formulas did not need to be converted to constants before sorting.

Excel sorts retain the order, so you actually only need the extra column
that carries the Grand Total (G) for sorting. Carrying both extra columns
though provides the ability to sort on names instead. You actually would
be better off leaving out the 1 & 2 suffixes on the name for the same
reason that Excel does retain the order of items not in the sort keys.

I've added your solution to my Fill Handle page
Sorting on a Value That Appears in Alternate Rows (#sortbyalt)
http://www.mvps.org/dmcritchie/excel....htm#sortbyalt
---
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

"arno" wrote...
hi jeff,
in y1 you write: =G2 (corrected)
in y2 you write: =G2

then you copy range (x1:y2) and paste it down the list, then you can sort
first by column y and then by x.

this will *only*work*if* ***all*** your records are using 2 lines.

arno





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default repost: connect two rows of data

Hi David,

I've added your solution to my Fill Handle page
Sorting on a Value That Appears in Alternate Rows (#sortbyalt)
http://www.mvps.org/dmcritchie/excel....htm#sortbyalt


:))


Excel sorts retain the order, so you actually only need the extra column
that carries the Grand Total (G) for sorting.


no,no,no,no! my solution will _always_ work, it does not depend on the
software. (what about making a query with access to the excel table?
wouldn't it be nice to be _absolutely_ sure about the sort order? what does
the excel sorting feature then help - nothing!) Whenever I reply to
somebody with a question re. sorting, I always stress the point that you
first try to get the data in the correct format from database-queries etc.,
if this is not possible make (dummy) columns that are representing the sort
criteria, then (with some textfunctions) you can concatenate the criteria to
another column (if you have more than 3 sorting columns) and then you sort.
So, you wanna sort a table? Then make sure you have _all_ the data that's
neccessary!

regards

arno




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
connect line to data points with missing data in between ziak Charts and Charting in Excel 4 April 4th 23 10:35 AM
How do I connect to access 2007 data from excel? Marilyn Myers Excel Discussion (Misc queries) 3 December 12th 08 04:15 PM
Deleting Rows and Shifting Up - Repost D.Parker Excel Discussion (Misc queries) 14 October 11th 07 04:58 AM
Using external data to connect to a .pst file Jackie Bauer Excel Discussion (Misc queries) 0 November 18th 06 11:12 PM
Repost:replacing data on a non focused worksheet with calculated data from the same sheet BruceJ[_2_] Excel Programming 0 November 11th 03 02:39 AM


All times are GMT +1. The time now is 09:30 AM.

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

About Us

"It's about Microsoft Excel"