View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave F Dave F is offline
external usenet poster
 
Posts: 2,574
Default how do I write an IF/other statement to cut off time data?

The square brackets are an indication that you need to put the appropriate
cell reference there. Eliminate the square brackets and re run your formula.

Dave
--
Brevity is the soul of wit.


"Daren" wrote:

It just says the formula contains an error then it takes me back u p to the
square parentheses.

"Dave F" wrote:

What's the error?
--
Brevity is the soul of wit.


"Daren" wrote:

I tried your formula, but it says that there's an error. I'm going to try to
fix it, but please continue to assist. Thanks.

"Dave F" wrote:

=IF(OR([cell with time in it]*247.5),([cell with time in
it]*24<=15.5),"Include","Exclude")

XL stores time as fractions of a 24 hour day. 7.5 is the numerical
equivalent of 7:30 AM (i.e., 7.5 hours of the 24 hour day have elapsed).
15.5 is the numerical equivalent of 3:30 PM.

Dave
--
Brevity is the soul of wit.


"Daren" wrote:

Ok, I've done that and it works. Thanks! Now how do I write the IF
statement to exclude times before 7:30 and ending after 15:30?

"Dave F" wrote:

Just select the date/time combinations, right click, format cells and format
as time. The date will be stripped out.

Dave
--
Brevity is the soul of wit.


"Daren" wrote:

I have data for start and end times on specific dates. The data in start
date/time is formatted as 10/01/2006 7:30, and in end date/time as 10/01/2006
15:30. When importing the data from another application into Excel, I only
want data returned from 7:30 to 15:30, but the application isn't doing that.
For example, it's pulling data such as 10/01/2006 16:00 for start time and
10/01/2006 18:00 for end time. Is there an IF statement (or other statement)
I can write in these cells to include only cases that start at and between
7:30 AM and end at and between 15:30 (3:30 PM)?