I am trying to write an IF statement to look at a range for time and return either Shift A or Shift B.
This is my formula that isn't working:
=IF(F2>TIME(6,0,0),IF(F2<TIME(16,0,0)),"A","B")
Use =AND where both (or more) conditions have to be met to result in TRUE. Then the second IF is not required. With:
=IF(AND(F2>TIME(6,0,0),F2<TIME(16,0,0)),"A","B")
Shift A applies to just after 06:00 hrs through to just before 16:00 hrs and Shift B otherwise. IF and F so intermingled in the same formula was a little unfortunate!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With