#1   Report Post  
mtate
 
Posts: n/a
Default IF function

I have a column called HOUR that contains numbers from 0 to 23. I am trying
to create a formula that with populate another column called called SHIFT
with the following:

Shift should = D if HOUR is 7 thru 18
Shift should = N if HOUR is 0 thru 6 or 20, 21, 22, 23

I was using the IF function. I know this should be simple, but can't get it
to work for all.
  #2   Report Post  
Niek Otten
 
Posts: n/a
Default

So, what did you try?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
"mtate" wrote in message
...
I have a column called HOUR that contains numbers from 0 to 23. I am
trying
to create a formula that with populate another column called called SHIFT
with the following:

Shift should = D if HOUR is 7 thru 18
Shift should = N if HOUR is 0 thru 6 or 20, 21, 22, 23

I was using the IF function. I know this should be simple, but can't get
it
to work for all.



  #3   Report Post  
mtate
 
Posts: n/a
Default

=IF(J43=7,"D",IF(J4320,"D","N"))
Everything shows up as D, even values over 20 and from 0 to 6.

"Niek Otten" wrote:

So, what did you try?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
"mtate" wrote in message
...
I have a column called HOUR that contains numbers from 0 to 23. I am
trying
to create a formula that with populate another column called called SHIFT
with the following:

Shift should = D if HOUR is 7 thru 18
Shift should = N if HOUR is 0 thru 6 or 20, 21, 22, 23

I was using the IF function. I know this should be simple, but can't get
it
to work for all.




  #4   Report Post  
Sandy Mann
 
Posts: n/a
Default

Shift should = D if HOUR is 7 thru 18
Shift should = N if HOUR is 0 thru 6 or 20, 21, 22, 23



You don't say what you want if Hour is 19 so assuming that you want Shift to
be N then try:

=IF(MOD(J43*7,133)48,"D","N")

HTH

Sandy





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
I NEED HELP with the SPELLNUMBER Function vag Excel Worksheet Functions 0 June 21st 05 08:17 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"