ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Joining rows with different data (https://www.excelbanter.com/excel-programming/394410-joining-rows-different-data.html)

[email protected]

Joining rows with different data
 
Hey there, I was wondering if it would be possible to have excel
consolidate my data in a way that I can use later for statistical
analysis.

I am currently working with a hospital database that outputs data in
the following way:

A= patient number
B= date test was completed
C= Hospital Test 1 (1st data value)
D= Hospital Test 1 (2nd data value)
E= Hospital Test 2 (1st data value)
F= Hospital Test 2 (2nd data value)
G= Hospital Test 3 where two different results were obtained on the
same day

The data needs to be consolidated onto one row for different tests
conducted on the same day for the same patient. An example is as
Follows

A B C D
E F G
1234 12-Dec-05 TestResult1 TestResult 2
1234 12-Dec-05 TestResult3
TestResult 4
1234 12-
Dec-05
TestResult 5
1234 12-
Dec-05
TestResult 6

I would need the macro or what not to organize the data as follows:

A B C D
E F G H
1234 12-Dec-05 TestResult1 TestResult 2 TestResult3 TestResult 4
TestResult5 TestResult6

* Where H is a column that the macro generates in order to fit the
data on the same line.


The macro would have to be able to go through every row in the
database and check for patient MRN and date match and then consolidate
the data in the way I just outlined. Is this possible at all? I would
REALLY appreciate any help.

Thanks so much!

J



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

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