excel help0r part VII

T

Testin da Cable

Guest
help me please:

I require a macro or otherwise for excel that does the following:

  • select all rows that do *NOT* begin with a cell that contains any of the following text: :00:, :15:, :30: or :45:
  • delete selected rows

you guessed it, it's a zillion row sheet, and I seriously can't go sifting through it by hand :( help0r me, and you earn a pint of your choice at the BarryBeer!!
 
J

Jupitus

Guest
Add a colum to the left of the data to act as an index, and autofill down sequential numbers 1,2,3 etc .... you can sort on this colum afterwards to return the data to its original sequence.

Next insert a column next to the column containing the ":00:" or whatever. In this column use this formula:

=IF(AND(ISERROR(FIND(":00:",A1)),ISERROR(FIND(":15:",A1)),ISERROR(FIND(":30:",A1)),ISERROR(FIND(":45:",A1))),1,0)

but replace the 4 cell references 'A1' with the cell containing the ":00:". You can now copy and paste this formula down the column, and it will give you a 1 if the 00 15 30 and 45 are NOT found, and a 0 if they are. When you have filled the column you can highlight the whole column and select 'edit, copy' and then 'edit, paste special, values'. You now have a column you can sort by (dont forget to select all of the data when you sort) and get all of the rows together that you need. Delete unwanted rows and then sort again using the first column of sequential numbers.

Genius:)

EDIT: Back it all up before starting!!!!!!!!!!!!!!!!!!!!!!!
 
J

Jupitus

Guest
Oh.... and if it doesn't work it is most likely that the cell we are testing is not formatted as text but is a time value... if you get an error let me know, it can be sorted out np.
 
T

Testin da Cable

Guest
woot, you rock!! and it's indeed a time formatted value, how do I fix that? if I format it as text it goes all to heck :(
 
J

Jupitus

Guest
new formula:

=IF(AND(ISERROR(FIND(":00:",TEXT(F1,"hh:mm:ss"))),ISERROR(FIND(":15:",TEXT(F1,"hh:mm:ss"))),ISERROR(FIND(":30:",TEXT(F1,"hh:mm:ss"))),ISERROR(FIND(":45:",TEXT(F1,"hh:mm:ss")))),1,0)


again, my cell reference F1 needs replacing with the actual cell on your sheet :)
 
T

Testin da Cable

Guest
hmm, excel says there's an error, then helpfully highlights the formula like so:

=IF(AND(ISERROR(FIND(":00:",TEXT(C3,"hh:mm:ss"))),ISERROR(FIND(":15:",TEXT(C3,"hh:mm:ss"))),ISERROR(FIND(":30:",TEXT(C3,"hh:mm:ss"))),ISERROR(FIND(":45:",TEXT(C3,"hh:mm:ss")))),1,0)

anything you can see? perhaps a typo that I made?
 
J

Jupitus

Guest
Can you type in here what the time data we are testing looks like?

Is it time AND date or just time?

Thanks

Edit: you have NOT made a typo, btw :)
 
T

Testin da Cable

Guest
sure, here's an example:

Code:
6		1:00:00	13	4	0	83
7		1:15:01	0	1	0	98
8		1:16:00	1	3	1	96
9		1:17:00	2	5	0	92
10		1:18:00	1	2	1	97
11		1:19:00	0	1	1	98
12		1:20:00	0	1	0	98
13		1:21:00	0	2	0	98
14		1:22:00	2	6	0	92
15		1:23:00	1	3	1	96
16		1:24:01	1	2	0	97
17		1:25:00	0	1	0	98
18		1:26:00	1	3	0	96
19		1:27:00	2	5	0	93
20		1:28:01	1	2	0	97
21		1:29:00	33	8	0	59
22		1:30:01	1	1	0	98

there's a sample being taken every minute, but that's far too much data. I want to show values every 15 minutes. I need to unleash something on the time colum that deletes all unneeded values. make the above look like the below:

Code:
6		1:00:00	13	4	0	83
7		1:15:01	0	1	0	98
22		1:30:01	1	1	0	98

thanks for taking the time to help me out, I really appreciate it :)

edit: the thing is over 20k rows long, that is why it isn't going to be a, ahem, hand-job :)
 
J

Jupitus

Guest
check your pm's tdc

edit: and hurry I'm out to lunch soon
 
T

Testin da Cable

Guest
sent. eat hearty mate, I'm off for a bite too :)
 
J

Jupitus

Guest
well I used the same formula in a cell to the right and it works fine - I expect you had a funny format in the 2nd column... perhaps try formatting column B as general and then pasting in the formula. Anyway - working version sent, have a nice day :)

*goes for lunch*
 
T

Testin da Cable

Guest
yay!

Jupitus - you rock, thanks so much for your trouble (it was indeed dodgy formatting I guess -all is fine now). if you're at the BarryBeer you'll have your pint :D

teh G - you also rock, but differently than Jupitus. I already knew about the autofilter, and was planning to unleash it's power apon a nice clean colum of 0's and 1's :) You too shall have a pint, unless you still drink that beastly stuff that smells like chewinggum ;)
 
X

xane

Guest
IF ( AND ( FIND ( "excel", TITLE ), NOT ( FIND ( "Software", FORUMTITLE ) ) ), ANSWER = "Wrong Forum, Idiot" )
 
T

Testin da Cable

Guest
begone beardy one!!! lest I strike you down with my leet new macro making skillz!!! :eek:

besides, excel brings me down in general. hur hur :(
 
O

old.D0LLySh33p

Guest
This thread is so much like real work it makes babeh jebus cry :(
 
T

Testin da Cable

Guest
I guess my saying that I never work is no longer as accurate as it used to be :(

*pine for good old days*
 
J

Jupitus

Guest
mmmm Beer is good!

Originally posted by Testin da Cable
yay!
Jupitus - you rock, thanks so much for your trouble (it was indeed dodgy formatting I guess -all is fine now). if you're at the BarryBeer you'll have your pint :D

Pint eh? I might have to think about coming along then ;)
 
T

Testin da Cable

Guest
just as long as it's not a pint of ritz reserve or other mouthwash that costs loads per picaliter mind :eek::):eek7:

edit: got one sheet done! five more to go though :(
 

Users who are viewing this thread

Similar threads

T
Replies
27
Views
964
Gumbo
G
T
Replies
31
Views
1K
FatBusinessman
F
T
Replies
40
Views
1K
Testin da Cable
T
T
Replies
42
Views
1K
mr.Blacky
M
S
Replies
20
Views
647
W
Top Bottom