IF function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
So, what did you try?

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
 
=IF(J43>=7,"D",IF(J43>20,"D","N"))
Everything shows up as D, even values over 20 and from 0 to 6.
 
Shift should = D if HOUR is 7 thru 18

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
 
or just:

=IF(MOD(J43,19)>6,"D","N")

--
HTH

Sandy
(e-mail address removed)


Replace@mailinator with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top