JMC57

Board Regular
Joined
Apr 24, 2012
Messages
118
Looking at the headers below I want to build a look up formula that will result in the latest (most recent date in list) transaction date (A) for a specific transaction type (B) for the MedID (D) for Station (E) and return the associated information in the desired results format listed below the original format.<o:p></o:p>
A<o:p></o:p>
B<o:p></o:p>
C<o:p></o:p>
D<o:p></o:p>
E<o:p></o:p>
TransactionDate<o:p></o:p>
Transaction<o:p></o:p>
MedDescription<o:p></o:p>
MedID<o:p></o:p>
Station<o:p></o:p>

<TBODY>
</TBODY>
<o:p> </o:p>
Desired results format<o:p></o:p>
A<o:p></o:p>
B<o:p></o:p>
C<o:p></o:p>
D<o:p></o:p>
E<o:p></o:p>
MedID<o:p></o:p>
Station<o:p></o:p>
TransDate Withdrawn<o:p></o:p>
TransDate Loaded<o:p></o:p>
Trans Date Unloaded<o:p></o:p>

<TBODY>
</TBODY>
<o:p> </o:p>
There are 3 transaction types. Loaded, Unloaded and Withdrawn. What I really need to know looking at over 60,000 lines of data: The date of most recent withrawn for a MedID, the most recent Loaded transaction if there is one and finally the most recent unloaded date is there is one line.<o:p></o:p>
Any help, suggestions will be appreciated. Thanks<o:p></o:p>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
[TransactionDate]</SPAN>[Transaction] </SPAN> [MedDescription]</SPAN>[MedID]</SPAN> [Station]</SPAN>
06/08/2013</SPAN>LOADED</SPAN>CARBAMAZEPINE200.000MGUDTAB </SPAN>TEGROT2002</SPAN> 5N1M</SPAN>
05/16/2013</SPAN>LOADED</SPAN>HYDROCODONE 5MG/APAP 3251.000TABTAB</SPAN>HYDR-2899</SPAN>5N1M</SPAN>
05/28/2013</SPAN>LOADED</SPAN>HYDROCODONE 10MG/APAP 3251.000TABTAB</SPAN>HYDR-2239</SPAN>5N1M</SPAN>
06/08/2013</SPAN>UNLOADED</SPAN>CARBAMAZEPINE200.000MGUDTAB</SPAN>TEGROT2002</SPAN>5N1M</SPAN>
05/30/2013</SPAN>UNLOADED</SPAN>HYDROCOD 5/APAP 5001.000UDTABTABLET</SPAN>HYDROT5102</SPAN>5N1M</SPAN>
06/03/2013</SPAN>UNLOADED</SPAN>HALOPERIDOL2.000MGTAB</SPAN>HALDOT2</SPAN>5N1M</SPAN>
06/03/2013</SPAN>UNLOADED</SPAN>HALOPERIDOL0.500MGUDTAB</SPAN>HALOOT.513</SPAN>5N1M</SPAN>
05/13/2013</SPAN>WITHDRAWN</SPAN>BUSPIRONE HCL5.000MGTABLET</SPAN>BUSPOT5101</SPAN>5N1M</SPAN>
05/13/2013</SPAN>WITHDRAWN</SPAN>BUSPIRONE HCL5.000MGTABLET</SPAN>BUSPOT5101</SPAN>5N1M</SPAN>
06/09/2013</SPAN>WITHDRAWN</SPAN>CARBAMAZEPINE100.000MGTAB</SPAN>TEGROT1001</SPAN>5N1M</SPAN>
06/09/2013</SPAN>WITHDRAWN</SPAN>CARBAMAZEPINE100.000MGTAB</SPAN>TEGROT1001</SPAN>5N1M</SPAN>
06/08/2013</SPAN>WITHDRAWN</SPAN>CARBAMAZEPINE100.000MGTAB</SPAN>TEGROT1001</SPAN>5N1M</SPAN>
06/08/2013</SPAN>WITHDRAWN</SPAN>CARBAMAZEPINE100.000MGTAB</SPAN>TEGROT1001</SPAN>5N1M</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL><COL></COLGROUP>
 
Upvote 0
Example with your data in A1:E14 (the formula cells are formatted as mm/dd/yyyy;; to suppress the display of zero):


Excel 2010
GHIJK
1MedIDStationWithdrawnLoadedUnloaded
2TEGROT20025N1M 06/08/201306/08/2013
3TEGROT10015N1M06/09/2013
Sheet3
Cell Formulas
RangeFormula
I2=MAX(INDEX(($D$2:$D$14=$G2)*($E$2:$E$14=$H2)*($B$2:$B$14=I$1)*$A$2:$A$14,))
 
Upvote 0
Thanks! You are very helpful.

Example with your data in A1:E14 (the formula cells are formatted as mm/dd/yyyy;; to suppress the display of zero):

Excel 2010
GHIJK
1MedIDStationWithdrawnLoadedUnloaded
2TEGROT20025N1M06/08/201306/08/2013
3TEGROT10015N1M06/09/2013

<COLGROUP><COL><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Sheet3

Worksheet Formulas
CellFormula
I2=MAX(INDEX(($D$2:$D$14=$G2)*($E$2:$E$14=$H2)*($B$2:$B$14=I$1)*$A$2:$A$14,))

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>
 
Upvote 0
How do I format the formula to show what you have in G though K. I could not replicate your results. Thanks
 
Upvote 0
G and H are manual inputs. The formula in I2 copied down and across is:

=MAX(INDEX(($D$2:$D$14=$G2)*($E$2:$E$14=$H2)*($B$2:$B$14=I$1)*$A$2:$A$14,))

Those cells are formatted as:

mm/dd/yyyy;;
 
Upvote 0

Forum statistics

Threads
1,216,115
Messages
6,128,923
Members
449,479
Latest member
nana abanyin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top