ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delete row depending on criteria (https://www.excelbanter.com/excel-discussion-misc-queries/33045-delete-row-depending-criteria.html)

adw223

Delete row depending on criteria
 

I have an Excel file with 2 worksheets where the data in the cells in
worksheet 2 is determined by the data in worksheet 1.

eg. =IF(AND(TRUE=Sheet1!C2,(MONTH(Sheet1!A2)=3)),Sheet 1!A2,"DELETE")

This means that if the date in cell A2 in sheet 1 is in March and cell
C2 in sheet 1 is TRUE then the cell that this formula is applied to
will be the same date as in cell A2 sheet 1 otherwise the cell says
DELETE. So I end up with something like the following in sheet 2

A B C
1 03 March 2005
2 DELETE
3 DELETE
4 06 March 2005
5 DELETE

Now my question is how do I get rid of the rows with DELETE without
using a macro. The idea is that I enter all the information that I am
dealing with into sheet 1 and that the relevant info is automatically
placed in the format I want in sheet 2.
Of course I’m open to a better formula than the one I’ve used. Any help
appreciated.


--
adw223
------------------------------------------------------------------------
adw223's Profile: http://www.excelforum.com/member.php...o&userid=24750
View this thread: http://www.excelforum.com/showthread...hreadid=383193


Dave Peterson

Apply Data|Filter|Autofilter
Show just the Deletes and delete the visible rows.

====
Or sort your data by that column and delete the first delete through the last
delete.

adw223 wrote:

I have an Excel file with 2 worksheets where the data in the cells in
worksheet 2 is determined by the data in worksheet 1.

eg. =IF(AND(TRUE=Sheet1!C2,(MONTH(Sheet1!A2)=3)),Sheet 1!A2,"DELETE")

This means that if the date in cell A2 in sheet 1 is in March and cell
C2 in sheet 1 is TRUE then the cell that this formula is applied to
will be the same date as in cell A2 sheet 1 otherwise the cell says
DELETE. So I end up with something like the following in sheet 2

A B C
1 03 March 2005
2 DELETE
3 DELETE
4 06 March 2005
5 DELETE

Now my question is how do I get rid of the rows with DELETE without
using a macro. The idea is that I enter all the information that I am
dealing with into sheet 1 and that the relevant info is automatically
placed in the format I want in sheet 2.
Of course I’m open to a better formula than the one I’ve used. Any help
appreciated.

--
adw223
------------------------------------------------------------------------
adw223's Profile: http://www.excelforum.com/member.php...o&userid=24750
View this thread: http://www.excelforum.com/showthread...hreadid=383193


--

Dave Peterson


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com