ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Cell value determined by the current time and date (https://www.excelbanter.com/excel-worksheet-functions/233677-cell-value-determined-current-time-date.html)

jschae

Cell value determined by the current time and date
 
I need a cells value to be displayed depending on the what the current time
of day it is. If the current time is between midnight and noon, then I want
the cell to equal "3rd Shift". If not, then the cell should be "1st Shift".
Any ideas on the best way to accomplish this?

Jacob Skaria

Cell value determined by the current time and date
 
=IF(HOUR(NOW())<=12,"3rd Shift","1st Shift")

If this post helps click Yes
---------------
Jacob Skaria


"jschae" wrote:

I need a cells value to be displayed depending on the what the current time
of day it is. If the current time is between midnight and noon, then I want
the cell to equal "3rd Shift". If not, then the cell should be "1st Shift".
Any ideas on the best way to accomplish this?


Mike H

Cell value determined by the current time and date
 
Try,

=IF(TIME(HOUR(NOW()),MINUTE(NOW()),0)TIME(12,0,0) ,"1st Shift","3rd Shift")

Mike

"jschae" wrote:

I need a cells value to be displayed depending on the what the current time
of day it is. If the current time is between midnight and noon, then I want
the cell to equal "3rd Shift". If not, then the cell should be "1st Shift".
Any ideas on the best way to accomplish this?


David Biddulph[_2_]

Cell value determined by the current time and date
 
Wouldn't that give 3rd shift for times up to 12:59:59.999 ?
You could try
=IF(MOD(NOW(),1)<=0.5,"3rd Shift","1st Shift")
--
David Biddulph

"Jacob Skaria" wrote in message
...
=IF(HOUR(NOW())<=12,"3rd Shift","1st Shift")

If this post helps click Yes
---------------
Jacob Skaria


"jschae" wrote:

I need a cells value to be displayed depending on the what the current
time
of day it is. If the current time is between midnight and noon, then I
want
the cell to equal "3rd Shift". If not, then the cell should be "1st
Shift".
Any ideas on the best way to accomplish this?




Jacob Skaria

Cell value determined by the current time and date
 
Thanks David for pointing that out...

Another way..
=IF(TEXT(NOW(),"AM/PM")="AM","3rd Shift","1st Shift")

If this post helps click Yes
---------------
Jacob Skaria


"David Biddulph" wrote:

Wouldn't that give 3rd shift for times up to 12:59:59.999 ?
You could try
=IF(MOD(NOW(),1)<=0.5,"3rd Shift","1st Shift")
--
David Biddulph

"Jacob Skaria" wrote in message
...
=IF(HOUR(NOW())<=12,"3rd Shift","1st Shift")

If this post helps click Yes
---------------
Jacob Skaria


"jschae" wrote:

I need a cells value to be displayed depending on the what the current
time
of day it is. If the current time is between midnight and noon, then I
want
the cell to equal "3rd Shift". If not, then the cell should be "1st
Shift".
Any ideas on the best way to accomplish this?






All times are GMT +1. The time now is 10:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com