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 |
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. |
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 |
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 |
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 |
All times are GMT +1. The time now is 03:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com