Solved

Newby question - Search Excel sheet and delete undesired lines

Posted on 2013-01-31
8
187 Views
Last Modified: 2013-06-25
Hi!

I am going over a very big excel file, and I want to summerise subjects.


I want to go over a specific column of the the whole sheet, and delete all lines which do not include a specific string (say "Brg").
How can I do it ?
I want to go over a specific column of the the whole sheet, and delete all lines which do not include one of X strings.
Example :  I want to delete all lines which do not include one of the following strings : {"Str_1", "Str_2", "String3", "Str4"}.
How can I do it ?
I want to go over a specific column of the the whole sheet, and delete all lines which do not include one of X strings (but do not delete lines which the cell is Empty).
Example :  I am going over column J, and I want to delete all lines which do not include one of the following strings : {"Str_1", "Str_2", "String3", "Str4"}, BUT I do not want to delete lines in which the "J cell" is empty.
How can I do it ?

After I delete all "undesired lines" I want to summerize Column K and Column M.
How can I do this ?


I am working with Office 2007

Thanks
zmau
0
Comment
Question by:zmau
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:NBVC
ID: 38841245
In a new column...

1. =ISNUMBER(SEARCH("Brg",j1))  copied down

2. =ISNA(MATCH(J1,{"Str_1","Str_2","String3","Str4"},0))  copied down

3: =AND(J1<>"",ISNA(MATCH(J1,{"Str_1","Str_2","String3","Str4"},0)))  copied down.

The TRUE results would be the rows to delete.
0
 
LVL 1

Author Comment

by:zmau
ID: 38843236
Thanks

I am not sure that I had understood.
1) Does this automatically delete the "undesired lines" ?
2) what is "copied down" ? Is this a valid Excel command ?
3) I was looking for a Macro.
4) I would like to look at the spreadsheet after the lines had been deleted.



Thanks
zmau
0
 
LVL 1

Author Comment

by:zmau
ID: 38843355
increase points
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 23

Expert Comment

by:NBVC
ID: 38843415
My solution is a formula solution.

You enter the formula in the first row of a free column, then copy it down the column.

You can then use Autofilter to filter for TRUE in that column and delete those rows.  Then switch off Autofilter to see the remaining rows.

Macros are out of my jurisdiction, sadly :(
0
 
LVL 1

Author Comment

by:zmau
ID: 38843419
Thanks,

Just one thing : How do I use Autofilter ?


zmau
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38843476
while you are in a cell in your table, go to Data and select Autofilter (the large Funnel icon).

You should see drop down arrows in the top row, go to the column with formulas.  Click the drop down arrow and check only the TRUE choice.

Now select all those rows and delete them.

Then reselect the filter and check ALL.
0
 
LVL 1

Author Comment

by:zmau
ID: 38843620
Thanks,

it almost works.....

I have two problems :

1.

Simple problem : when I try to summerize column M, is summerises also the hidden lines....
How can I summerize only the non hidden lines ?

2.

The file becomes much larger than the original file because of the "copy down step".
Here is how I "copy down" :  
Press Ctrl+C
go down one cell
Press Shift+End keys
Press down key
Now all of a sudden I have a milion lines (instead of the original 30,000 lines)
The problem is that now calculating the formula and/or saving the file takes a lot of time


Thanks
zmau
0
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 38843662
After you enter the formula in one cell copy it, then select the next cell down, go to the bottom of the sheet where your last row is, then hold the SHIFT key down and select the bottom cell, then copy.

You can then copy the column, right click, select Paste Special, then Values, this will remove the formulas.

Then filter.

If you are not deleting the "TRUE" rows, you can use SUBTOTAL() function.

e.g. =SUBTOTAL(9,M:M) will sum only the visible cells.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question