I am using Excel 2003. I need a formula or macro that can delete or identify rows that have a unique combination of cells in columns A and B, while ignoring the data in columns C, D, and E. Thanks.
I am using Excel 2003. I need a formula or macro that can delete or identify rows that have a unique combination of cells in columns A and B, while ignoring the data in columns C, D, and E. Thanks.
Here's a simple way which uses a couple of helper columns.
In F2 (assume row1 contains column headers), put in this formula:
In G2 put in this formula:Please Login or Register to view this content.
Fill both the formulae down to the last row of data.Please Login or Register to view this content.
Since you want to delete any combination which appears only once, filter column G by TRUE and delete the visible rows.
1) Put a formula in an empty column that "tests" the A:B values. Something along the lines of:
M2: =($A2 & "-" & $B2 = "code1-code2")
That's a TRUE/FALSE construct. Edit the code1-code2 to the actual two strings you're trying to match.
2) Copy that formula down the data set to get all the TRUE/FALSE answers
3) Highlight the column and turn on the Data > Filter > Autofilter
4) Filter the column for FALSE
5) Highlight and delete all the remaining visible rows
6) Turn off the autofilter and clear the column you used
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
This worked great! Thanks!!
If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks