bhutchinson
New Member
- Joined
- Jun 10, 2011
- Messages
- 5
Excerpt from a sheet of data is below. I need an if statement that will evaluate several data elements and flag the most recent date when selected criteria are met.
I can then do a simple data sort or pivot table and isolate only the most recent status dates and statuses IF the account # and case # are equal (repeated)
If the account # is repeated in several rows I need it to evaluate the case #, and status date
If the case # is repeated in several rows, I need to evaluate the status date associated with the case and flag the most recent status
There may only be a single account # and case # in some instances.
[TABLE="width: 1107"]
<tbody>[TR]
[TD]Acct # [/TD]
[TD]Status Date [/TD]
[TD]Status [/TD]
[TD]Case # [/TD]
[TD]ID [/TD]
[TD]Criteria [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]3/9/2015[/TD]
[TD]2[/TD]
[TD]1414980[/TD]
[TD]13[/TD]
[TD]Most Recent status date for 1011171 for case 1414980 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]12/3/2014[/TD]
[TD]1[/TD]
[TD]1414980[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]12/3/2014[/TD]
[TD]6[/TD]
[TD]1414980[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]8/27/2014[/TD]
[TD]2[/TD]
[TD]1411223[/TD]
[TD]13[/TD]
[TD]Most Recent status date for 1011171 for case 1411223 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]3/26/2014[/TD]
[TD]1[/TD]
[TD]1411223[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]3/26/2014[/TD]
[TD]6[/TD]
[TD]1411223[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]7/2/2014[/TD]
[TD]2[/TD]
[TD]1411574[/TD]
[TD]13[/TD]
[TD]Most recent status date for account # 10111321 for case # 1411574 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]4/15/2014[/TD]
[TD]1[/TD]
[TD]1411574[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]4/15/2014[/TD]
[TD]6[/TD]
[TD]1411574[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]1/9/2008[/TD]
[TD]3[/TD]
[TD]0512996[/TD]
[TD]13[/TD]
[TD]Most recent status date for account 10111327 for case 0512996 FLAG[/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]10/5/2015[/TD]
[TD]2[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]Most recent status date for account 10113100 for case # 1456363 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]11/13/2014[/TD]
[TD]T[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]9/8/2014[/TD]
[TD]1[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]9/8/2014[/TD]
[TD]6[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]2/11/2014[/TD]
[TD]2[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]Most recent status date for account 10113100 for case # 1352578 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]12/3/2013[/TD]
[TD]3[/TD]
[TD]1356435[/TD]
[TD]7[/TD]
[TD]Most recent status date for account 10113100 for case # 1356435 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]8/13/2013[/TD]
[TD]6[/TD]
[TD]1356435[/TD]
[TD]7[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]7/18/2013[/TD]
[TD]T[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]4/2/2013[/TD]
[TD]1[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]4/2/2013[/TD]
[TD]6[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]4/2/2013[/TD]
[TD]9[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]7/21/2011[/TD]
[TD]3[/TD]
[TD]0655575[/TD]
[TD]13[/TD]
[TD]Most recent status date for 10113100 for case # 0655575 FLAG [/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col></colgroup>[/TABLE]
I can then do a simple data sort or pivot table and isolate only the most recent status dates and statuses IF the account # and case # are equal (repeated)
If the account # is repeated in several rows I need it to evaluate the case #, and status date
If the case # is repeated in several rows, I need to evaluate the status date associated with the case and flag the most recent status
There may only be a single account # and case # in some instances.
[TABLE="width: 1107"]
<tbody>[TR]
[TD]Acct # [/TD]
[TD]Status Date [/TD]
[TD]Status [/TD]
[TD]Case # [/TD]
[TD]ID [/TD]
[TD]Criteria [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]3/9/2015[/TD]
[TD]2[/TD]
[TD]1414980[/TD]
[TD]13[/TD]
[TD]Most Recent status date for 1011171 for case 1414980 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]12/3/2014[/TD]
[TD]1[/TD]
[TD]1414980[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]12/3/2014[/TD]
[TD]6[/TD]
[TD]1414980[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]8/27/2014[/TD]
[TD]2[/TD]
[TD]1411223[/TD]
[TD]13[/TD]
[TD]Most Recent status date for 1011171 for case 1411223 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]3/26/2014[/TD]
[TD]1[/TD]
[TD]1411223[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10111171[/TD]
[TD="align: right"]3/26/2014[/TD]
[TD]6[/TD]
[TD]1411223[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]7/2/2014[/TD]
[TD]2[/TD]
[TD]1411574[/TD]
[TD]13[/TD]
[TD]Most recent status date for account # 10111321 for case # 1411574 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]4/15/2014[/TD]
[TD]1[/TD]
[TD]1411574[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]4/15/2014[/TD]
[TD]6[/TD]
[TD]1411574[/TD]
[TD]13[/TD]
[TD]delete[/TD]
[/TR]
[TR]
[TD="align: right"]10111327[/TD]
[TD="align: right"]1/9/2008[/TD]
[TD]3[/TD]
[TD]0512996[/TD]
[TD]13[/TD]
[TD]Most recent status date for account 10111327 for case 0512996 FLAG[/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]10/5/2015[/TD]
[TD]2[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]Most recent status date for account 10113100 for case # 1456363 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]11/13/2014[/TD]
[TD]T[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]9/8/2014[/TD]
[TD]1[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]9/8/2014[/TD]
[TD]6[/TD]
[TD]1456363[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]2/11/2014[/TD]
[TD]2[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]Most recent status date for account 10113100 for case # 1352578 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]12/3/2013[/TD]
[TD]3[/TD]
[TD]1356435[/TD]
[TD]7[/TD]
[TD]Most recent status date for account 10113100 for case # 1356435 FLAG [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]8/13/2013[/TD]
[TD]6[/TD]
[TD]1356435[/TD]
[TD]7[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]7/18/2013[/TD]
[TD]T[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]4/2/2013[/TD]
[TD]1[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]4/2/2013[/TD]
[TD]6[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]4/2/2013[/TD]
[TD]9[/TD]
[TD]1352578[/TD]
[TD]13[/TD]
[TD]delete [/TD]
[/TR]
[TR]
[TD="align: right"]10113100[/TD]
[TD="align: right"]7/21/2011[/TD]
[TD]3[/TD]
[TD]0655575[/TD]
[TD]13[/TD]
[TD]Most recent status date for 10113100 for case # 0655575 FLAG [/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col></colgroup>[/TABLE]