How to delete correct # of rows
Ok, by reading each of your reply posts, I think I understand your logic, so
I'll post that here for your confirmation and for the benefit of the other
folks following this thread.
For each account number in column A, count the number of times that item
occurs in column A (CountIf). Then, look at the number in column B, which
appears to always remain the same for any specific account number. Subtract
this number from the CountIf from Column A. That represents the number of
"deletes", and all other rows would be ignored.
Krystal-
Do you just want that final number per account, or do you need any
additional information?
What information do you want returned in situations where the number of
"rows to delete" (column B) is greater than the number of times that account
number shows up (CountIf on column A)?
"Krystal Peters" wrote:
For (2) Col A does not increment as they are acct #'s; Col B let me know the
maximum # of rows I can delete. Below I showed in a third col what i would
like to happen...
SAMPLE DATA:
ACCT_NO Requests Found action to take
289278995 1 delete
289278999 1 keep
289278999 1 keep
289278999 1 delete
870587008 1 delete
119387014 1 delete
158675527 2 delete
654375649 2 delete
569777245 2 delete
752478468 2 delete
752478468 2 delete
396378512 2 delete
396378512 2 delete
396378512 2 keep
396378512 2 keep
399778090 3 delete
399778090 3 delete
399778090 3 delete
208777882 4 delete
208777882 4 delete
208777882 4 delete
208777882 4 delete
208777882 4 keep
987178737 4 delete
987178737 4 delete
117468837 7 delete
117468837 7 delete
117468837 7 delete
117468837 7 delete
|