Remove row set based on compare

projectile

Board Regular
Joined
Dec 14, 2007
Messages
193
Hello

I have this extract from msquery , and cannot find a way to exclude customers that have both to codes against their client record, SPQ & FUP for a particular date range. I cannot get the query to work, so think it best to return the figures to excel, and run a compare macro on the table.


Is it possible to do the following;

run a compare on the client column and activity column;;

If a client has has both a SPQ & FUP entry on different rows, then remove all instances of client row, then continue this down the sheet, so that all clients with both codes are removed.

e.g. if clients no. 003212 has both codes SPQ & FUP , then remove entire rows for 003212. i.e. in example below, 4 rows for INternational Ltd would be removed. In the example below, the entire rows in yellow should be removed, based on criteria above.


hope this makes sense.


activity.gif
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
makes it a bit easier:


=IF(ISNA(IF(C2<>"SPQ","delete",IF(ISNA(MATCH(B2&"FUP",D:D,0)),(MATCH(B2&"JOB",D:D,0)),"delete"))),"","delete")

cheers.
 
Upvote 0
Hi
Couldn't that one to work, it was including activity codes that should be marked as deleted.

So i used your previous formula and added an autofilter, and appears to work, until someone spots an issue :(

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,796
Members
449,095
Latest member
m_smith_solihull

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