Results 1 to 2 of 2

Macro to choose which formula to use.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Macro to choose which formula to use.

    Basically I need to have a macro fill in a formula based on if a value exists.

    So for this example cell M2 contains the following formula:
    `=IF(AND(D2>$O$1,D2<$P$1),D2-$O$2,IF(AND(D2>$P$1,D2<$Q$1),D2-$P$2,IF(AND(D2>$Q$1,D2<$R$1),D2-$Q$2,IF(D2>=$R$1,D2-$R$2,""))))
    And cell N2 contains the following formula:

    `=IF(AND(D2>$O$3,D2<$P$3),D2-$O$4,IF(AND(D2>$P$3,D2<$Q$3),D2-$P$4,IF(AND(D2>$Q$3,D2<$R$3),D2-$Q$4,IF(D2>=$R$3,D2-$R$4,""))))
    What I need is someway to check if $J$2-d2 >2

    Cell L2 contains the difference between the employees time and the average shift length. (which would be the number 2 after the > in the example above)

    If there would be anyway of making the number 2 variable with the use of a text box or something that would be even better.
    Last edited by randell.graybill; 05-07-2009 at 09:25 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1