Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default what is the time of the day

I need a formula that will tell me the time of the day. i have a field with
the date and time (mm/dd/yy hh:mm PM). I need the formula to return the hour
of the day if the hour is after 5PM. For example, if it is 11/29/08 5:23 PM
i want it to return "5". If it is 11/27/08 6:46 PM, i want it to return "6".
For anything before 5PM, i want it to return "before 5".
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default what is the time of the day

try sth. like

=IF(HOUR(NOW())<5,"before 5",HOUR(NOW())))

adjust for AM/PM accordingly

On 11 Gru, 16:25, tomas wrote:
I need a formula that will tell me the time of the day. *i have a field with
the date and time (mm/dd/yy hh:mm PM). *I need the formula to return the hour
of the day if the hour is after 5PM. *For example, if it is 11/29/08 5:23 PM
i want it to return "5". *If it is 11/27/08 6:46 PM, i want it to return "6".
*For anything before 5PM, i want it to return "before 5".
Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default what is the time of the day

=IF(MOD(NOW(),1)<--"17:00","Before 5",HOUR(NOW()))

you need to press F9 to update the formula

--


Regards,


Peo Sjoblom

"tomas" wrote in message
...
I need a formula that will tell me the time of the day. i have a field
with
the date and time (mm/dd/yy hh:mm PM). I need the formula to return the
hour
of the day if the hour is after 5PM. For example, if it is 11/29/08 5:23
PM
i want it to return "5". If it is 11/27/08 6:46 PM, i want it to return
"6".
For anything before 5PM, i want it to return "before 5".
Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default what is the time of the day

If my date and time field is on column A, how do i edit your formula?

"Peo Sjoblom" wrote:

=IF(MOD(NOW(),1)<--"17:00","Before 5",HOUR(NOW()))

you need to press F9 to update the formula

--


Regards,


Peo Sjoblom

"tomas" wrote in message
...
I need a formula that will tell me the time of the day. i have a field
with
the date and time (mm/dd/yy hh:mm PM). I need the formula to return the
hour
of the day if the hour is after 5PM. For example, if it is 11/29/08 5:23
PM
i want it to return "5". If it is 11/27/08 6:46 PM, i want it to return
"6".
For anything before 5PM, i want it to return "before 5".
Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default what is the time of the day

If my date and time field is on column A, how do i edit your formula?

"Jarek Kujawa" wrote:

try sth. like

=IF(HOUR(NOW())<5,"before 5",HOUR(NOW())))

adjust for AM/PM accordingly

On 11 Gru, 16:25, tomas wrote:
I need a formula that will tell me the time of the day. i have a field with
the date and time (mm/dd/yy hh:mm PM). I need the formula to return the hour
of the day if the hour is after 5PM. For example, if it is 11/29/08 5:23 PM
i want it to return "5". If it is 11/27/08 6:46 PM, i want it to return "6".
For anything before 5PM, i want it to return "before 5".
Thanks.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default what is the time of the day

Your question was interpreted by both responders to mean you wanted to know
the time right now. If you want to check the hour of a time in a cell you
have, substitute that cell for "Now()", as in:

=if(hour(a1)<17,"Before 5",hour(a1)-12)

Regards,
Fred.

"tomas" wrote in message
...
If my date and time field is on column A, how do i edit your formula?

"Peo Sjoblom" wrote:

=IF(MOD(NOW(),1)<--"17:00","Before 5",HOUR(NOW()))

you need to press F9 to update the formula

--


Regards,


Peo Sjoblom

"tomas" wrote in message
...
I need a formula that will tell me the time of the day. i have a field
with
the date and time (mm/dd/yy hh:mm PM). I need the formula to return
the
hour
of the day if the hour is after 5PM. For example, if it is 11/29/08
5:23
PM
i want it to return "5". If it is 11/27/08 6:46 PM, i want it to
return
"6".
For anything before 5PM, i want it to return "before 5".
Thanks.





  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default what is the time of the day

Beautiful! Thanks.

"Fred Smith" wrote:

Your question was interpreted by both responders to mean you wanted to know
the time right now. If you want to check the hour of a time in a cell you
have, substitute that cell for "Now()", as in:

=if(hour(a1)<17,"Before 5",hour(a1)-12)

Regards,
Fred.

"tomas" wrote in message
...
If my date and time field is on column A, how do i edit your formula?

"Peo Sjoblom" wrote:

=IF(MOD(NOW(),1)<--"17:00","Before 5",HOUR(NOW()))

you need to press F9 to update the formula

--


Regards,


Peo Sjoblom

"tomas" wrote in message
...
I need a formula that will tell me the time of the day. i have a field
with
the date and time (mm/dd/yy hh:mm PM). I need the formula to return
the
hour
of the day if the hour is after 5PM. For example, if it is 11/29/08
5:23
PM
i want it to return "5". If it is 11/27/08 6:46 PM, i want it to
return
"6".
For anything before 5PM, i want it to return "before 5".
Thanks.





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
straight time, time and a half, and double time Jeremy Excel Discussion (Misc queries) 3 September 23rd 08 09:03 PM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
verify use of TIME Function, Find Quantity Level compare to time-d nastech Excel Discussion (Misc queries) 9 July 11th 07 01:58 PM
Formula to find Stop Time from Start Time and Total Minutes Jonathan Bickett Excel Worksheet Functions 5 March 7th 07 05:22 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM


All times are GMT +1. The time now is 04:24 AM.

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"