IF statement macro

  • Thread starter Thread starter Qwerty
  • Start date Start date
Q

Qwerty

I've been trying to convert an IF statement to something I can run in a
macro with no success.

Here is the statement
=IF(=MOD(NOW(),1)<=0.270833333333333,"SHIFT:
3RD",IF(=MOD(NOW(),1)<=0.604166666666667,"SHIFT:
1ST",IF(=MOD(NOW(),1)<=0.9375,"SHIFT: 2ND",IF(=MOD(NOW(),1)<=1,"SHIFT:
3RD",""))))

It started out as this
=IF(T2<=T3,"SHIFT: 3RD",IF(T2<=T4,"SHIFT: 1ST",IF(T2<=T5,"SHIFT:
2ND",IF(T2<=T6,"SHIFT: 3RD",""))))

Cell T2 is =MOD(NOW(),1)
Cell T3 is 0.270833333333333
Cell T4 is 0.604166666666667
Cell T5 is 0.9375
Cell T6 is 1

I don't want the macro to refer to the cells but the actual formulas/values
in the string because I want to delete the cells so that the worksheet isn't
updated when opened, only when I run the macro.

I would appreciate any help on this code since I am relatively new to
macros.

TIA
 
Back
Top