ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   How to link rows in Excel so they will stay together during sort? (https://www.excelbanter.com/charts-charting-excel/33788-how-link-rows-excel-so-they-will-stay-together-during-sort.html)

hospital dietitian

How to link rows in Excel so they will stay together during sort?
 
In Excel I am trying to track body weights over time for hospital patients,
linked with specific interventions on the row below. I would like to link
these 2 rows of data permanently so that when I sort based on intervention,
the body weight data will stay with the intervention.

ExcelBanter AI

Answer: How to link rows in Excel so they will stay together during sort?
 
To link rows in Excel so they will stay together during sort, you can use the "Group" feature. Here's how:
[list=1][*]Select the two rows you want to link together.[*]Right-click on the selection and choose "Group" from the menu.[*]A dialog box will appear asking you whether you want to group rows or columns. Choose "Rows" and click "OK".[*]You will notice that a small number "2" appears to the left of the row numbers, indicating that the two rows are now grouped together.[*]Now, when you sort your data based on intervention, the body weight data will stay with the intervention because the two rows are linked together.

Note that if you have more than two rows that you want to link together, you can select all of them and group them in the same way. Also, be careful when inserting or deleting rows within a group, as this can cause the group to become unlinked.

Jon Peltier

Excel doesn't work like this. Each row in a list is a distinct record.
Your intervention information should go in the same row as the patient
data, in the sortable database. You could construct a display worksheet
that linked two rows of cells to one row of the data worksheet.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


hospital dietitian wrote:

In Excel I am trying to track body weights over time for hospital patients,
linked with specific interventions on the row below. I would like to link
these 2 rows of data permanently so that when I sort based on intervention,
the body weight data will stay with the intervention.


guanto

Quote:

Originally Posted by hospital dietitian (Post 111240)
In Excel I am trying to track body weights over time for hospital patients,
linked with specific interventions on the row below. I would like to link
these 2 rows of data permanently so that when I sort based on intervention,
the body weight data will stay with the intervention.


I having similar troubles!

my potential solution is to somehow convert the related rows into objects (in my case i have 4-5 rows of 33 columns, and couple of hundred of these 4-row objects). then the sorting would be done by accessing certain attribute of the multi-row object, and have the result displayed in some other format as oppose to having them directly sorted. perhaps graphically or onto another sheet.

the other solution would be stuffing the 4 rows into 1 as the above poster suggested. i think that would be much more doable, but at the cost of being able to sort out certain relationship within the 4 rows.


anyone want to shed more light on how to continue with the first potential solution?


thanks,
guanto

David of XL Plus

Quote:

Originally Posted by guanto (Post 958759)
I having similar troubles!

my potential solution is to somehow convert the related rows into objects (in my case i have 4-5 rows of 33 columns, and couple of hundred of these 4-row objects). then the sorting would be done by accessing certain attribute of the multi-row object, and have the result displayed in some other format as oppose to having them directly sorted. perhaps graphically or onto another sheet.

the other solution would be stuffing the 4 rows into 1 as the above poster suggested. i think that would be much more doable, but at the cost of being able to sort out certain relationship within the 4 rows.


anyone want to shed more light on how to continue with the first potential solution?


thanks,
guanto


Hi,

New to this forum but far from new to Excel and VBA.

Can assist by automating the conversion of your 4-5 rows into a single row if you really want to go that route.

Would like to suggest an alternative.

Can I assume that not all patients get/suffer(?) every intervention?

With a Macro you can create a report based on a specific intervention.

This would show a baseline and post intervention result, just for the patients having THAT particular intervention.

OR

Can show baseline, and results for all interventions on a patient-by-patient basis.

Happy to assist with this one off-line, as now too specific an issue for most users.

Regards

David

Educo


All times are GMT +1. The time now is 06:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com