Another Index Match question (I think)

TyeReece

Board Regular
Joined
Aug 3, 2007
Messages
136
My worksheet has 3 columns. A person, a date and a rating (1 to 5). People may have various number of ratings and the data are sorted by ID and date. I need to find and keep any records for a person that are after the most recent rating >3. Any help is appreciated.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Can you give an example of your data and (crucially) of the desired result of the computation?

J.Ty.
 
Upvote 0
Attached is a link to my data. I have separated each ID with a blank row to make it easier to view but my thought is that there is a formula I can put in cell D1 that I can auto fill down. What I want is to keep all of the records for an ID going back in time (data sorted by ID and Date in descending order) until there is a value >3 in column C for an ID. Does this make sense?

https://www.dropbox.com/s/p53g4hhjdy7da4a/Level 3 in Residential.xlsx?dl=0
 
Upvote 0
Yes, I know now what you mean. I will make it today.

J.Ty.
 
Upvote 0
Sorry, one more question:
what about this record:
3239469/10/20021del

<tbody>
</tbody>

This is the earliest assgnment lower than 3 for this child.

J.Ty.
 
Upvote 0
Thanks so much. Once there is a record >3, everything before it I don't want. Put another way, all IDs most recent LOC will be 3 or lower. I want to go back in time, checking each LOC until there is one greater than 3.
 
Upvote 0
What should I do if the first record for a particular ID is already >3? Should I go ahead and remove all records for that ID?

J.Ty.
 
Upvote 0
Per the query design, the first record will always be 3 or less. But for using for other applications, yes it would remove all the records for that ID.
 
Upvote 0
Here it is.
Instruction:
Coulmns A-D - your data
Column E - computing keep/del from the records
Columns F-G - help computations
Columns H-J - the records to be kept

Indeed you may use only column E from my solution, create a filter on it and let it hide all records to be deleted, saving on computations carried out in columns F-J.

J.Ty.


Excel 2010
ABCDEFGHIJ
1Id_IndDate Child First Assigned LOC 3 or LowerLoc0Id_IndDate Child First Assigned LOC 3 or LowerLoc
22220411/6/20163keepkeep112220411/6/20163
322204110/2/20153keepkeep2222204110/2/20153
42220412/9/20154deldel282405753/15/20163
52220412/6/20153deldel2925072112/29/20153
62220413/4/20143deldel2102507219/29/20153
722204112/4/20133deldel2112507216/24/20153
82220416/5/20134deldel2122507214/1/20153
92405753/15/20163keepkeep3283081411/14/20163
1025072112/29/20153keepkeep4303239463/10/20163
112507219/29/20153keepkeep53132394612/3/20153
122507216/24/20153keepkeep6373645571/21/20163
132507214/1/20153keepkeep7#N/A
142507219/24/20144deldel7#N/A
152507214/16/20144deldel7#N/A
162507211/14/20144deldel7#N/A
1725072110/16/20135deldel7#N/A
182507217/8/20135deldel7#N/A
192507214/12/20134deldel7#N/A
202507211/16/20134deldel7#N/A
2125072110/19/20124deldel7#N/A
222507217/19/20124deldel7#N/A
232507214/20/20125deldel7#N/A
242507211/23/20125deldel7#N/A
252507218/11/20115deldel7#N/A
262507212/9/20114deldel7#N/A
2725072111/8/20104deldel7#N/A
282507215/10/20105deldel7#N/A
293081411/14/20163keepkeep8#N/A
303081417/14/20155deldel8#N/A
313239463/10/20163keepkeep9#N/A
3232394612/3/20153keepkeep10#N/A
333239469/3/20154deldel10#N/A
343239466/5/20154deldel10#N/A
353239463/10/20154deldel10#N/A
363239469/11/20144deldel10#N/A
373239469/10/20021deldel10#N/A
383645571/21/20163keepkeep11#N/A
393645577/23/20154deldel11#N/A
403645571/15/20134deldel11#N/A
Sheet2
Cell Formulas
RangeFormula
E2=IF(C2>3,"del","keep")
E3=IF(OR(AND(A3=A2,E2="del"),C3>3),"del","keep")
F2=IF(E2="keep",F1+1,F1)
F3=IF(E3="keep",F2+1,F2)
G2=MATCH(ROW()-1,$F$2:$F$40,0)
G3=MATCH(ROW()-1,$F$2:$F$40,0)
H2=IFERROR(INDEX(A$2:A$40,$G2),"")
H3=IFERROR(INDEX(A$2:A$40,$G3),"")
I2=IFERROR(INDEX(B$2:B$40,$G2),"")
I3=IFERROR(INDEX(B$2:B$40,$G3),"")
J2=IFERROR(INDEX(C$2:C$40,$G2),"")
J3=IFERROR(INDEX(C$2:C$40,$G3),"")
 
Upvote 0
P.S.
Note that formulas in E2 and E3 are different. Number 0 in F1 is necessary.

J.Ty.
 
Upvote 0

Forum statistics

Threads
1,214,556
Messages
6,120,190
Members
448,949
Latest member
keycalinc

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