time-rounding,and if then statements

amcmillio

New Member
Joined
Oct 8, 2002
Messages
13
I have a spreadsheet that has 2000 points of time listed. The time is in 22 minute incremants. I only want the cells with the time that are closest to the hour. It is never the same. How can I delete the cells that are not closest to the hour without doing it manually? I have 40 other spreadsheets to do the same with. Please help me to find a way to stop doing it manually and get rid of my headache. Is there a formula I can use? I am not use to using time in formulas.

Example:
11:06 (I would keep)
11:28 (I would delete)
11:50 (I would keep)
12:12 (I would delete)
12:34 (I would delete)
12:56 (I would keep)
1:18 (I would delete)
Etc...
This message was edited by amcmillio on 2002-10-09 13:25
 
On 2002-10-09 14:41, amcmillio wrote:
I am for the most part using the time in between 15 minutes before the hour and 15 minutes after the hour but not always. If you notice I would not keep rows 4, 15 and 22 which are in between 15 minutes before amd 15 minutes after the hour.

Ok, Why would you not keep rows 4,15,and 22?
Not trying to be difficult; just trying to understand :biggrin:
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
The light may be dawning in my brain! Are you saying that for every hh:00 covered by your data, you want to look at the reading before and after hh:00 and just keep one reading for that hour, deleting all other readings?
 
Upvote 0
You are not being difficult- this is a hard one to understand...
Here you go...

My goal is to keep only the rows that round up or round down to the nearest hour.
I would keep 1 because it would represent 11:00. I would not keep 2. I would keep 3 because it is closer to 12:00 than 4. I would not keep 5. I would keep 6 because it would represent 1:00. I would not keep 7 or 8. I would keep 9 because it would represent 2:00. Etc... Does it make sense now?
 
Upvote 0
Guess what...I have another question. :LOL:

What if your example data had started with row 3 where the time was 11:50. Would you want to count that row for 11:00 as well as 12:00 or just for 12:00?
 
Upvote 0
The following is an Array Formula; enter it with Ctrl-Shift-Enter

1. I named the range of times "rT"

EDIT I also put 1/24 into a cell named "Hr"

2. B1 has 11:00 and B2 has 12:

=OR(MAX(IF(((rT-($B$1+(INT(ROW()/3))*Hr))^2=MIN((rT-($B$1+(INT(ROW()/3))*Hr))^2))*rT,rT))=A1,MAX(IF(((rT-($B$2+(INT(ROW()/3))*Hr))^2=MIN((rT-($B$2+(INT(ROW()/3))*Hr))^2))*rT,rT))=A1 )

Please advise if this formula works for you.

Can the time be in 24 hour format then test
for 1:00 PM is really a test for 13:00?

The formula yields True or False; Filter and then Delete.

Dave
This message was edited by Dave Patton on 2002-10-09 16:19
This message was edited by Dave Patton on 2002-10-09 16:37
 
Upvote 0
Hi amcmillio,
Simple!
Steve was on the right way. As your intervals are of 22 minutes - the times close to any full hour MUST fall between xx:49 and xx:11.
Therefore we can check with MINUTE function if the minutes are less/equal 11 OR greater/equal 49.
If yes KEEP, if no DELETE.
Look at my example below.

Now SORT your data on column E to have all the rows which are assignd "keep" in one group and drop the rest.
Good luck,
Eli
Book1
ABCDE
1PointDateTimeSensor1Keep/Delete
218/23/0211:06:13AM75.8Keep
328/23/0211:28:13AM75.6Delete
438/23/0211:50:13AM75.3Keep
548/23/0212:12:13PM87.8Delete
658/23/0212:34:13PM92.4Delete
768/23/0212:56:13PM97.8Keep
878/23/021:18:13PM101Delete
988/23/021:40:13PM102.9Delete
1098/23/022:02:13PM104.8Keep
11108/23/022:24:13PM105.6Delete
Sheet1

This message was edited by eliW on 2002-10-10 02:22
 
Upvote 0

Forum statistics

Threads
1,215,770
Messages
6,126,790
Members
449,336
Latest member
p17tootie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top