Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default Greater than/Less than a certain Time

Hello,

I've got a helper column (column B) with a formula that looks at a
time stamp in column A. I'm trying to get each cell in column B to
say Yes if the time in the adjoining cell in column A is earlier than
3:30 pm, and No if it's later than 3:30 pm. What I currently have is
below, but this returns the error message #NAME?

=IF(K2="","",IF(K2<3:30 PM,"yes","no"))

I also tried putting the desired cutoff time in quotes (as below), but
that returns 'no' no matter what time is in the cell.

=IF(K2="","",IF(K2<"3:30 PM","yes","no"))

What do I need to change to make this work? Thanks.

Frank
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: Greater than/Less than a certain Time

Hi Frank,

To make this formula work, you need to enclose the time in quotes and use the
Code:
TIME
function to specify the time. Here's the corrected formula:
  1. =IF(K2="","",IF(K2<TIME(15,30,0),"Yes","No"))

This formula checks if the cell in column K is blank. If it is, it returns a blank cell. If it's not blank, it checks if the time in that cell is earlier than 3:30 pm (which is represented by the
Code:
TIME
function with 15 hours and 30 minutes). If it is, it returns "Yes". If it's not, it returns "No".



__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 51
Default Greater than/Less than a certain Time

Try:

=IF(K2="","",IF(K2<Timevalue("3:30 PM"),"yes","no"))

Regards,
Steve

Phrank wrote:

Hello,

I've got a helper column (column B) with a formula that looks at a
time stamp in column A. I'm trying to get each cell in column B to
say Yes if the time in the adjoining cell in column A is earlier than
3:30 pm, and No if it's later than 3:30 pm. What I currently have is
below, but this returns the error message #NAME?

=IF(K2="","",IF(K2<3:30 PM,"yes","no"))

I also tried putting the desired cutoff time in quotes (as below), but
that returns 'no' no matter what time is in the cell.

=IF(K2="","",IF(K2<"3:30 PM","yes","no"))

What do I need to change to make this work? Thanks.

Frank


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Greater than/Less than a certain Time

What do I need to change to make this work?

A little bit of number type coercion:
=IF(K2="","",IF(K2<(--"3:30 PM"),"yes","no"))

The dbl-negative causes Excel to implicitly convert the text "3:30 PM" into
a time value.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Phrank" wrote:

Hello,

I've got a helper column (column B) with a formula that looks at a
time stamp in column A. I'm trying to get each cell in column B to
say Yes if the time in the adjoining cell in column A is earlier than
3:30 pm, and No if it's later than 3:30 pm. What I currently have is
below, but this returns the error message #NAME?

=IF(K2="","",IF(K2<3:30 PM,"yes","no"))

I also tried putting the desired cutoff time in quotes (as below), but
that returns 'no' no matter what time is in the cell.

=IF(K2="","",IF(K2<"3:30 PM","yes","no"))

What do I need to change to make this work? Thanks.

Frank

  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Greater than/Less than a certain Time

Try this:

=IF(K2="","",IF(K2<--"3:30 PM","yes","no"))


"Phrank" wrote:

Hello,

I've got a helper column (column B) with a formula that looks at a
time stamp in column A. I'm trying to get each cell in column B to
say Yes if the time in the adjoining cell in column A is earlier than
3:30 pm, and No if it's later than 3:30 pm. What I currently have is
below, but this returns the error message #NAME?

=IF(K2="","",IF(K2<3:30 PM,"yes","no"))

I also tried putting the desired cutoff time in quotes (as below), but
that returns 'no' no matter what time is in the cell.

=IF(K2="","",IF(K2<"3:30 PM","yes","no"))

What do I need to change to make this work? Thanks.

Frank

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default Greater than/Less than a certain Time

Excellent! All works now. Formatting was wrong. Thank you very much
everyone!

Frank

On Thu, 23 Nov 2006 08:31:01 -0800, Teethless mama
wrote:

Try this:

=IF(K2="","",IF(K2<--"3:30 PM","yes","no"))


"Phrank" wrote:

Hello,

I've got a helper column (column B) with a formula that looks at a
time stamp in column A. I'm trying to get each cell in column B to
say Yes if the time in the adjoining cell in column A is earlier than
3:30 pm, and No if it's later than 3:30 pm. What I currently have is
below, but this returns the error message #NAME?

=IF(K2="","",IF(K2<3:30 PM,"yes","no"))

I also tried putting the desired cutoff time in quotes (as below), but
that returns 'no' no matter what time is in the cell.

=IF(K2="","",IF(K2<"3:30 PM","yes","no"))

What do I need to change to make this work? Thanks.

Frank

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot key for time? Dave in Des Moines New Users to Excel 2 March 24th 06 05:31 PM
Hot key for time? Dave in Des Moines Excel Worksheet Functions 2 March 24th 06 05:15 PM
Hot key for time? Dave in Des Moines Excel Discussion (Misc queries) 1 March 24th 06 04:46 PM
time sheet to calculate 2 different columns John Sullivan Excel Worksheet Functions 1 October 21st 05 06:48 AM
count TIME that is GREATER than 24 hours JonPilot Excel Worksheet Functions 1 January 31st 05 11:55 PM


All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"