Solved

Newby question - Search Excel sheet and delete undesired lines

Posted on 2013-01-31
8
159 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now