Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
James
 
Posts: n/a
Default PLEASE help with IF function...

I have a spreadsheet that i need to clean up. I have many duplicates that i
need to delete. Here is the problem; I don't want to delete ALL the
duplicates.
Here's an example:

A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
3 9/30/2004 F2 60A155-100 105445 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 RE 60A155-100 105445 Duplicate


If B1="F2" AND it is more recent (A) then the subsequent "RE" in B2, i want
to leave it and delete the "RE" line (Row 2).

But if :
A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 F2 60A155-100 105445 Duplicate


If B4="RE" AND is the more recent one, i want to delete both rows 4 and 5
both.

any ideas? i can go through each one but my report is huge!

TIA

James



  #2   Report Post  
Max
 
Posts: n/a
Default

Not very sure, but no harm trying this on a *spare* copy ..

Assuming source data below is in cols A to D, from row1 down:
A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
3 9/30/2004 F2 60A155-100 105445 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 RE 60A155-100 105445 Duplicate


Put in E1:
=IF(AND(B1="F2",A1=A2),"",IF(AND(B1="RE",A1=A2), "X",""))
Copy down

Col E will tag an "X" for the rows to be deleted

For the sample data above, E2, E4 and E5 will return "X"'s
Confirm this is correct before you proceed further

Assuming the "X''s are correctly returned:

Kill the formulas in col E with
an in-place copy paste special values ok

Insert a new row1, and put a label into E1

Select E1 and click Data Filter Autofilter
Filter out: X (select from droplist)

Select all the filtered rows (i.e. select the blue-colored row headers)
Right-click on selection Delete rows

Remove the autofilter
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"James" wrote in message
...
I have a spreadsheet that i need to clean up. I have many duplicates that

i
need to delete. Here is the problem; I don't want to delete ALL the
duplicates.
Here's an example:

A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
3 9/30/2004 F2 60A155-100 105445 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 RE 60A155-100 105445 Duplicate


If B1="F2" AND it is more recent (A) then the subsequent "RE" in B2, i

want
to leave it and delete the "RE" line (Row 2).

But if :
A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 F2 60A155-100 105445 Duplicate


If B4="RE" AND is the more recent one, i want to delete both rows 4 and 5
both.

any ideas? i can go through each one but my report is huge!

TIA

James





  #3   Report Post  
James
 
Posts: n/a
Default

Max! you da'man!

thanks, i was creeping up on the very same idea, but you were one step ahead
of me!
"Max" wrote in message
...
Not very sure, but no harm trying this on a *spare* copy ..

Assuming source data below is in cols A to D, from row1 down:
A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
3 9/30/2004 F2 60A155-100 105445 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 RE 60A155-100 105445 Duplicate


Put in E1:
=IF(AND(B1="F2",A1=A2),"",IF(AND(B1="RE",A1=A2), "X",""))
Copy down

Col E will tag an "X" for the rows to be deleted

For the sample data above, E2, E4 and E5 will return "X"'s
Confirm this is correct before you proceed further

Assuming the "X''s are correctly returned:

Kill the formulas in col E with
an in-place copy paste special values ok

Insert a new row1, and put a label into E1

Select E1 and click Data Filter Autofilter
Filter out: X (select from droplist)

Select all the filtered rows (i.e. select the blue-colored row headers)
Right-click on selection Delete rows

Remove the autofilter
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"James" wrote in message
...
I have a spreadsheet that i need to clean up. I have many duplicates

that
i
need to delete. Here is the problem; I don't want to delete ALL the
duplicates.
Here's an example:

A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
3 9/30/2004 F2 60A155-100 105445 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 RE 60A155-100 105445 Duplicate


If B1="F2" AND it is more recent (A) then the subsequent "RE" in B2, i

want
to leave it and delete the "RE" line (Row 2).

But if :
A B C D
1 2/4/2005 F2 60A155-100 105588 Duplicate
2 2/1/2005 RE 60A155-100 105588 Duplicate
4 9/30/2004 RE 60A155-100 105445 Duplicate
5 9/30/2004 F2 60A155-100 105445 Duplicate


If B4="RE" AND is the more recent one, i want to delete both rows 4 and

5
both.

any ideas? i can go through each one but my report is huge!

TIA

James







  #4   Report Post  
Max
 
Posts: n/a
Default

Glad it worked for you !
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"James" wrote in message
...
Max! you da'man!

thanks, i was creeping up on the very same idea, but you were one step

ahead
of me!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Need a ISWorkday Function -- Any Ideas Mark Excel Worksheet Functions 5 March 29th 05 01:58 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM


All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"