RE: Comparing multiple rows of data
- From: Joel <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 Jul 2008 06:42:00 -0700
We are getting closer to getting all the info needed to write the macro or
formula.
1) Are you going to run the macro on the preformatted report or the last
*** with all the data?
2) What is the name of the workshheet.
You may be able to use a simple formula. If the event number is in column A
and the data is in column B
Put in a new column in Row 2
=if(A2<>1,if(B2>B1,if(B3>30,"Increase over 30","Increase under
30"),"decrease"),"")
or
=if(A2<>1,if(B2>B1,"Increase","Yecrease"),"")
"stewpot" wrote:
Hi Joel.
The data I have comes from an Oracle 10g db, the user in the hospital opens
up the excel workbook which contains 3 worksheets. The first options
work*** asks the user to select the start and end dates for the report and
three other variables ( all run by macros behind select buttons.) The other
two worksheets are the results worksheet which is a preformatted report,
showing only the data relating to the variables chosen above and the last
*** is the actual data retrieved from Oracle with all the code, defined
names etc used on the results ***.
What else do you need in able to help me??
"Joel" wrote:
Th esolution to this problem depends on where you place the results and how
you want to review the results. Some people may recommend for you not to use
a macro and use sumproduct, but I think this is not the best solution.
My recommend datations is to copy the data to another work*** and to sort
by patient names and dates. Then remove any patients who where in the
hospital only once and to keep only the last two visits to the hospital for
each patient. I can help write the macro if this is what you want.
It would help if you can post a sample of the patient data. sort the
patient by name and dates so we can see the columns top compare. then change
the patient names and other vital info. You only need to post a few examples
of the data along with the columns and work*** name where the data is
located.
"stewpot" wrote:
I have hundreds of rows of patient data and within that data I need to look
at each individual patients data.
For every patient I have several rows of data, each row contains the same
fields but they relate to different events in their hospital stay which are
numbered 1,2,3,etc. I am trying to compare the latest event with the previous
event (e.g. event 3 with event 2) and show whether their test results (which
is a number) increase or decrease and if for instance it increases and is now
over 30, count it as a yes and if it goes down count it as a no. The macro
will need to identify the most recent event and then compare this to the
previous event, this will be different for each patient record. Can you help?
- Follow-Ups:
- RE: Comparing multiple rows of data
- From: stewpot
- RE: Comparing multiple rows of data
- Prev by Date: Re: Displayed caption font increases on each click
- Next by Date: RE: Positioning datalabels
- Previous by thread: RE: Comparing multiple rows of data
- Next by thread: RE: Comparing multiple rows of data
- Index(es):
Loading