Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Newby question - Search Excel sheet and delete undesired lines

Posted on 2013-01-31
8
Medium Priority
?
200 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 1500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

885 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