Need a nested if statement to evaluate several data elements vertically

Status
Not open for further replies.

bhutchinson

New Member
Joined
Jun 10, 2011
Messages
5
An excerpt from my data is below. I need to evaluate:

the account #. If it repeats in several rows I need to
Evaluate the case #. If it repeats in several rows I need to
Evaluate the status date and FLAG only the most recent (newest) date when the account # AND the Case # are repeated.
I can then do a data sort or pivot and delete the old statuses and dates I do not want to review.


[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]
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Duplicate https://www.mrexcel.com/forum/excel-questions/1051956-need-nested-if-statement.html

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums.
When this happens, you should see a message to that effect when you try to post it. Please be patient and do not attempt to post the question again.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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