+ Reply to Thread
Results 1 to 5 of 5

Need a wildcard solution in an IF statement

  1. #1
    Registered User
    Join Date
    11-18-2011
    Location
    Tucson
    MS-Off Ver
    Excel 2003
    Posts
    12

    Need a wildcard solution in an IF statement

    My IF statement returns one of two text strings I need to get a return on. My project is a work schedule that looks back and returns employees that are not currently working or scheduled for a day/night shift (to cover openings). If an employee works the night before an opening, he is only available to cover a night opening. In column be I have this statement:

    =IF(OFFSET(INDEX(JAN12!C:AG,MATCH($U$6:$U$13,JAN12!$B:$B,0),MATCH($G$2,DATEJAN12,0)),0,-1)="N","NiO","")

    I need to return "NiO" for one two conditions on the Jan tab "WN" or "N", for any date prior to to the input date in G2 on the WOJ tab. Any ideas/solutions are much appreciated.

    Thanks..
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Need a wildcard solution in an IF statement

    cant quite see what you want but this bit is just wrong
    MATCH($U$6:$U$13,JAN12!$B:$B,0)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-18-2011
    Location
    Tucson
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Need a wildcard solution in an IF statement

    Martin, Thanks for the reply. This is a test workbook for a large schedule (12 months and more employees) for a 24 hour operation. Finding someone who is off to call and cover sick and vacation can be dificult. If you enter a date in WOJ G2, it returns those that are off ("A") on that date (eventually I hope this work on the entire year and be on one tab and a simple format). The problem with the return in Column A is that it does not identify someone who worked the prior night, they can't get off work at say 6a am and continue to work that day for another 12 hours (not allowed). Column B, identifies if they worked the night before, so if they are off on Day G2, they can work a night shift only ("NiO"). Based on your reply I tested the statement I have in Column B, by changing text in JAN tab, ex. enter "N" for all employees on Jan 4 and clear all text in Jan 5 enter 01/05/12 in G2 WOJ tab it worked OK.

    My problem is, there are two abbreviations to identify someone working at night, "N" (normal schedule) and "WN" (overtime night shift), I am wondering if there is a modification to my IF statement that I can include a return of "NiO" if the previous night is "WN". This is only for the JAN tab, the other tabs identify the employees last workover for first call purposes.

    I should have mentioned this for excel 2003. I'm a novice with excel and not sure why the MATCH statement works (or honestly) it just seems to return what I need (at least for this portion of the problem).

    I hope this clears up your question, it sure was a lot of splan'n. Thanks again.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Need a wildcard solution in an IF statement

    sorry still don't understand,

  5. #5
    Registered User
    Join Date
    11-18-2011
    Location
    Tucson
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Need a wildcard solution in an IF statement

    OK, well thanks for checking it out

+ Reply to Thread

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