Results 1 to 1 of 1

Works fine but hoping to simplify

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    26

    Works fine but hoping to simplify

    (If this isn't the correct place to ask please let me know.)

    I have a template i created to verify time entered on cards and if there are any errors it indicates the amount of time to move to correct it. It works, but i'm just wondering if there is a more simplified way to write the formulas for ST to OT and OT to ST.

    Attached some sample data with values to show what it does. If anyone would like to offer some suggestions i would greatly appreciate it .

    Current formula for OT to ST:
    =IF(IFERROR(MATCH([@[State / Province]],Canada[State / Province],0),),IF(AND([@ST]<=INDEX(Canada,MATCH([@[State / Province]],Canada[State / Province],0),MATCH(Canada[[#Headers],[Hours]],Canada[#Headers],0)),[@OT]>(INDEX(Canada,MATCH([@[State / Province]],Canada[State / Province],0),MATCH(Canada[[#Headers],[Hours]],Canada[#Headers],0))-[@ST])),INDEX(Canada,MATCH([@[State / Province]],Canada[State / Province],0),MATCH(Canada[[#Headers],[Hours]],Canada[#Headers],0))-[@ST],IF([@[ST to OT]]>0,,[@OT])),IF(AND([@ST]<40,[@OT]>(40-[@ST])),40-[@ST],IF([@[ST to OT]]>=0,,[@OT])))
    Current formula for ST to OT:
    =IF(IFERROR(MATCH([@[State / Province]],Canada[State / Province],0),),IF([@ST]>=INDEX(Canada,MATCH([@[State / Province]],Canada[State / Province],0),MATCH(Canada[[#Headers],[Hours]],Canada[#Headers],0)),[@ST]-INDEX(Canada,MATCH([@[State / Province]],Canada[State / Province],0),MATCH(Canada[[#Headers],[Hours]],Canada[#Headers],0)),),IF([@ST]>40,[@ST]-40,))
    Again this is really just for learning purposes as it works fine, just seems extremely repetitive.

    ST-OT - Sample.xlsx
    Last edited by Simon3; 09-16-2015 at 02:39 PM. Reason: added code tags (didn't know formulas required them)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Goal Seek not working on 1 PC but works fine on another?
    By jennymc in forum Excel General
    Replies: 7
    Last Post: 07-11-2013, 10:49 AM
  2. Macro works fine until documents closed
    By a_gunslinger in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2011, 04:17 PM
  3. Vlookup works fine, but not in Macro
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2010, 12:54 PM
  4. Macro works fine... until I save it
    By hoffey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2009, 04:34 PM
  5. [SOLVED] Macro hangs up often but sometimes works fine
    By Jeff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2006, 08:10 AM
  6. Macro works fine on PC; fails on Mac
    By marlea in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2006, 04:35 PM
  7. Works fine in debug, but...
    By DiBaco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-24-2006, 12:40 PM

Tags for this Thread

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