Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
rkemper
 
Posts: n/a
Default Logic formula using Time

I am trying to write a formula that compares a variable time to a fixed time.
If the variable is greater than the fixed, I assign it the value "1" and if
it is less than, I assign in the value "0".

The formula I'm trying to use is: =IF(A1A2,1,0) where A1 is the variable
time.

The problem I have is that the fixed time is 12:00 AM, so Excel is reading
all variable times as GREATER than and assigning a "1".

How can I write the formula so that 11:50 PM (the previous calendar day)
will read as LESS THAN the fixed 12:00 AM (the following calendar day)?



--
Thanks!

RKEMPER
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Logic formula using Time

Use Excel "serial dates" and format them to show time.

Excel uses a date scheme called serial dates, in which a day is an
integer number and a time is a fractional part of a day. Right now the
time is 12/22/2005 15:58 in my time zone; the serial date equivalent of
that is 38708.66530. Test this by entering =NOW() into any cell of
your spreadsheet, then format that cell to view as a number with a few
decimal places.

If you set up your dates using serial dates, your formula will work
properly.

  #3   Report Post  
Posted to microsoft.public.excel.misc
RagDyer
 
Posts: n/a
Default Logic formula using Time

Use dates and custom format the cells to show only the time.
Enter:
..12/22/05 12:00 a

And format:
hh:mm
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"rkemper" wrote in message
...
I am trying to write a formula that compares a variable time to a fixed

time.
If the variable is greater than the fixed, I assign it the value "1" and

if
it is less than, I assign in the value "0".

The formula I'm trying to use is: =IF(A1A2,1,0) where A1 is the

variable
time.

The problem I have is that the fixed time is 12:00 AM, so Excel is reading
all variable times as GREATER than and assigning a "1".

How can I write the formula so that 11:50 PM (the previous calendar day)
will read as LESS THAN the fixed 12:00 AM (the following calendar day)?



--
Thanks!

RKEMPER


  #4   Report Post  
Posted to microsoft.public.excel.misc
rkemper
 
Posts: n/a
Default Logic formula using Time

Thanks. That worked!
--
Thanks!

RKEMPER


"RagDyer" wrote:

Use dates and custom format the cells to show only the time.
Enter:
..12/22/05 12:00 a

And format:
hh:mm
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"rkemper" wrote in message
...
I am trying to write a formula that compares a variable time to a fixed

time.
If the variable is greater than the fixed, I assign it the value "1" and

if
it is less than, I assign in the value "0".

The formula I'm trying to use is: =IF(A1A2,1,0) where A1 is the

variable
time.

The problem I have is that the fixed time is 12:00 AM, so Excel is reading
all variable times as GREATER than and assigning a "1".

How can I write the formula so that 11:50 PM (the previous calendar day)
will read as LESS THAN the fixed 12:00 AM (the following calendar day)?



--
Thanks!

RKEMPER



  #5   Report Post  
Posted to microsoft.public.excel.misc
RagDyer
 
Posts: n/a
Default Logic formula using Time

Appreciate the feed-back.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"rkemper" wrote in message
...
Thanks. That worked!
--
Thanks!

RKEMPER


"RagDyer" wrote:

Use dates and custom format the cells to show only the time.
Enter:
..12/22/05 12:00 a

And format:
hh:mm
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"rkemper" wrote in message
...
I am trying to write a formula that compares a variable time to a

fixed
time.
If the variable is greater than the fixed, I assign it the value "1"

and
if
it is less than, I assign in the value "0".

The formula I'm trying to use is: =IF(A1A2,1,0) where A1 is the

variable
time.

The problem I have is that the fixed time is 12:00 AM, so Excel is

reading
all variable times as GREATER than and assigning a "1".

How can I write the formula so that 11:50 PM (the previous calendar

day)
will read as LESS THAN the fixed 12:00 AM (the following calendar

day)?



--
Thanks!

RKEMPER




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
Formula is entering a default time when it comes across an empty cell.. Howie Excel Worksheet Functions 10 November 16th 05 11:34 AM
'Time to Fix' Formula wlln001 Excel Discussion (Misc queries) 1 September 7th 05 12:11 PM
Formula to deduct unpaid breaks in time sheet Rick Excel Discussion (Misc queries) 3 August 26th 05 11:53 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Time / Formula to look at time difference carl Excel Worksheet Functions 5 November 8th 04 06:59 PM


All times are GMT +1. The time now is 09:43 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"