Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default iwhich funvtion to use : in conversion of date and hour to day and

First of all it is not 18:00PM. Miltary (24 hour time) does not use AM, PM.
If you want the hours between 7:00 and 18:00 to be day and the rest night,
and A1 contains the date and time, the it's simply

=IF(AND(MOD(A1,1)=VALUE("7:00"),MOD(A1,1)<=VALUE( "18:00")),"Day","Night")
or
=IF(AND(MOD(A1,1)=VALUE("7:00 AM"),MOD(A1,1)<=VALUE("6:00
PM")),"Day","Night")

I find that easy to understand

Tyro


"kbee" wrote in message
...
I need to convert the data from a cell that contains date and time to a
different cell that will give a result of day /night, which functions
should
I use and what will be their syntax?
if the hours i refere to as day are 7:00AM-18:00PM, and night
18:00Pm-07:00AM
thank you



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default iwhich funvtion to use : in conversion of date and hour to day

the formula results: value and not d/n
how would u change it to express d/n with the original cell only includes
the "hour am/pm" ?
thanx

"Tyro" wrote:

First of all it is not 18:00PM. Miltary (24 hour time) does not use AM, PM.
If you want the hours between 7:00 and 18:00 to be day and the rest night,
and A1 contains the date and time, the it's simply

=IF(AND(MOD(A1,1)=VALUE("7:00"),MOD(A1,1)<=VALUE( "18:00")),"Day","Night")
or
=IF(AND(MOD(A1,1)=VALUE("7:00 AM"),MOD(A1,1)<=VALUE("6:00
PM")),"Day","Night")

I find that easy to understand

Tyro


"kbee" wrote in message
...
I need to convert the data from a cell that contains date and time to a
different cell that will give a result of day /night, which functions
should
I use and what will be their syntax?
if the hours i refere to as day are 7:00AM-18:00PM, and night
18:00Pm-07:00AM
thank you



t

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
Count by date and hour ChristiaanV Excel Worksheet Functions 4 August 12th 06 12:26 AM
Comparing specific date and hour with NOW() Memoman Excel Worksheet Functions 1 July 15th 06 10:14 PM
convert decimal numbers to a fraction of an hour for payroll hour Flower Excel Worksheet Functions 4 February 10th 06 07:46 PM
Convert Date/Time to the Hour eric_rs1 Excel Discussion (Misc queries) 2 October 3rd 05 04:40 PM
Subtracting date:hour from date:hour [email protected] Excel Worksheet Functions 4 August 26th 05 08:35 AM


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