PC Review


Reply
Thread Tools Rate Thread

Conditional Statements and Time Format

 
 
robofanuc@yahoo.com
Guest
Posts: n/a
 
      21st Nov 2006
Hello,

I have a spreadsheet where I need to calculate a range of time in a
cell and display a value in another cell.

Example is in cell F2 I have a time displayed of 15:34, and in the
calculation window it displays as 3:34:00 PM. In Cell F3 I want to
display one of three things, "1st shift", "2nd shift" or "3rd shift".
Is it possible to use the conditional statements to give me the value
of "1st shift" when cell F2 is between >= 07:00 and < 15:00?

I can't find anything that speaks to getting thee range information
from time.

Thanks,
Brian

 
Reply With Quote
 
 
 
 
Bob Umlas
Guest
Posts: n/a
 
      21st Nov 2006
=IF(AND(F2>=TIMEVALUE("07:00"),F2<TIMEVALUE("15:00")),"1st Shift","")

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I have a spreadsheet where I need to calculate a range of time in a
> cell and display a value in another cell.
>
> Example is in cell F2 I have a time displayed of 15:34, and in the
> calculation window it displays as 3:34:00 PM. In Cell F3 I want to
> display one of three things, "1st shift", "2nd shift" or "3rd shift".
> Is it possible to use the conditional statements to give me the value
> of "1st shift" when cell F2 is between >= 07:00 and < 15:00?
>
> I can't find anything that speaks to getting thee range information
> from time.
>
> Thanks,
> Brian
>



 
Reply With Quote
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      21st Nov 2006
Try something like this:

With
F2: (a time value)

This formula returns the corresponding shift
F3: =CHOOSE(INT(MOD(A1-7/24,1)*3)+1,"1st","2nd","3rd")&" shift"

Where:
Shift 1 is from 11 PM (inclusive) to 7 AM (exclusive)
Shift 2 is from 7 AM (inclusive) to 3 PM (exclusive)
Shift 3 is from 3 PM (inclusive) to 11 PM (exclusive)

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"(E-Mail Removed)" wrote:

> Hello,
>
> I have a spreadsheet where I need to calculate a range of time in a
> cell and display a value in another cell.
>
> Example is in cell F2 I have a time displayed of 15:34, and in the
> calculation window it displays as 3:34:00 PM. In Cell F3 I want to
> display one of three things, "1st shift", "2nd shift" or "3rd shift".
> Is it possible to use the conditional statements to give me the value
> of "1st shift" when cell F2 is between >= 07:00 and < 15:00?
>
> I can't find anything that speaks to getting thee range information
> from time.
>
> Thanks,
> Brian
>
>

 
Reply With Quote
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      21st Nov 2006
Ummmm....typo (sorry)

The formula should refer to F2 (NOT A1)
F3: =CHOOSE(INT(MOD(F2-7/24,1)*3)+1,"1st","2nd","3rd")&" shift"

***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

> Try something like this:
>
> With
> F2: (a time value)
>
> This formula returns the corresponding shift
> F3: =CHOOSE(INT(MOD(A1-7/24,1)*3)+1,"1st","2nd","3rd")&" shift"
>
> Where:
> Shift 1 is from 11 PM (inclusive) to 7 AM (exclusive)
> Shift 2 is from 7 AM (inclusive) to 3 PM (exclusive)
> Shift 3 is from 3 PM (inclusive) to 11 PM (exclusive)
>
> Is that something you can work with?
> ***********
> Regards,
> Ron
>
> XL2002, WinXP
>
>
> "(E-Mail Removed)" wrote:
>
> > Hello,
> >
> > I have a spreadsheet where I need to calculate a range of time in a
> > cell and display a value in another cell.
> >
> > Example is in cell F2 I have a time displayed of 15:34, and in the
> > calculation window it displays as 3:34:00 PM. In Cell F3 I want to
> > display one of three things, "1st shift", "2nd shift" or "3rd shift".
> > Is it possible to use the conditional statements to give me the value
> > of "1st shift" when cell F2 is between >= 07:00 and < 15:00?
> >
> > I can't find anything that speaks to getting thee range information
> > from time.
> >
> > Thanks,
> > Brian
> >
> >

 
Reply With Quote
 
diablo
Guest
Posts: n/a
 
      21st Nov 2006
Works great Ron, thanks.

Brian (at home address)

--

"Ron Coderre" <(E-Mail Removed)> wrote in message
news:E036B063-B0D4-463C-865E-(E-Mail Removed)...
> Ummmm....typo (sorry)
>
> The formula should refer to F2 (NOT A1)
> F3: =CHOOSE(INT(MOD(F2-7/24,1)*3)+1,"1st","2nd","3rd")&" shift"
>
> ***********
> Regards,
> Ron
>
> XL2002, WinXP
>
>
> "Ron Coderre" wrote:
>
>> Try something like this:
>>
>> With
>> F2: (a time value)
>>
>> This formula returns the corresponding shift
>> F3: =CHOOSE(INT(MOD(A1-7/24,1)*3)+1,"1st","2nd","3rd")&" shift"
>>
>> Where:
>> Shift 1 is from 11 PM (inclusive) to 7 AM (exclusive)
>> Shift 2 is from 7 AM (inclusive) to 3 PM (exclusive)
>> Shift 3 is from 3 PM (inclusive) to 11 PM (exclusive)
>>
>> Is that something you can work with?
>> ***********
>> Regards,
>> Ron
>>
>> XL2002, WinXP
>>
>>
>> "(E-Mail Removed)" wrote:
>>
>> > Hello,
>> >
>> > I have a spreadsheet where I need to calculate a range of time in a
>> > cell and display a value in another cell.
>> >
>> > Example is in cell F2 I have a time displayed of 15:34, and in the
>> > calculation window it displays as 3:34:00 PM. In Cell F3 I want to
>> > display one of three things, "1st shift", "2nd shift" or "3rd shift".
>> > Is it possible to use the conditional statements to give me the value
>> > of "1st shift" when cell F2 is between >= 07:00 and < 15:00?
>> >
>> > I can't find anything that speaks to getting thee range information
>> > from time.
>> >
>> > Thanks,
>> > Brian
>> >
>> >



 
Reply With Quote
 
diablo
Guest
Posts: n/a
 
      21st Nov 2006
This works too, thanks.

Brian

--

"Bob Umlas" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> =IF(AND(F2>=TIMEVALUE("07:00"),F2<TIMEVALUE("15:00")),"1st Shift","")
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello,
>>
>> I have a spreadsheet where I need to calculate a range of time in a
>> cell and display a value in another cell.
>>
>> Example is in cell F2 I have a time displayed of 15:34, and in the
>> calculation window it displays as 3:34:00 PM. In Cell F3 I want to
>> display one of three things, "1st shift", "2nd shift" or "3rd shift".
>> Is it possible to use the conditional statements to give me the value
>> of "1st shift" when cell F2 is between >= 07:00 and < 15:00?
>>
>> I can't find anything that speaks to getting thee range information
>> from time.
>>
>> Thanks,
>> Brian
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Conditional Format Pietro Microsoft Access 1 24th Nov 2008 06:28 PM
apply conditional format to time TD Microsoft Excel Worksheet Functions 1 27th May 2008 11:44 PM
Conditional Format - MIN, IF statements =?Utf-8?B?Ym9i?= Microsoft Excel Worksheet Functions 9 8th Oct 2007 11:08 PM
If statements for time format =?Utf-8?B?U2hlc2g=?= Microsoft Excel Worksheet Functions 1 11th Feb 2005 11:57 PM
Re: What is Date/Time format in SQL string statements? Rick Brandt Microsoft Access Queries 0 23rd Jun 2004 04:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 PM.