+ Reply to Thread
Results 1 to 4 of 4

Assistance with If And statement

  1. #1
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    164

    Assistance with If And statement

    Ok all,
    This is probably really simple, but I'm doing something wrong here and could really use some help. I have an Excel table that I'm building in Excel 2010 to track the status of Truck Cabs & Trailers for a warehouse. I'm inserting a new row every time a trailer goes out on a delivery at the top of my table so the newest data is always on top.

    The issue I'm having is on column O called "In Yard". I'm trying to input a statement that will say "In Yard" in the cell if the "Trailer Number" is still in the yard for only the most recent time the trailer came back, but NOT say in yard on the rows of prior data for this same trailer. So I have columns in the table for "Trailer Number" column D, "Time Out" column L, & "Time In" Column M. The statement I have that seems like it should work is: =IF(AND(D5=[Trailer Number],[@[Time In]]<>"",[Time Out]>M5),"In Yard","").

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Assistance with If And statement

    Try this in O5, then copy down:

    =IF(AND(NOT(ISNUMBER(MATCH(D5,$D$4:$D4,0))), M5<>""),"In Yard", "")


    With this formula, "In Yard" can only appear if it's the FIRST instance of the trailer number AND column M is not empty.
    Last edited by JBeaucaire; 09-01-2013 at 09:56 AM. Reason: Formula correction.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: Assistance with If And statement

    That is exactly what I needed. I've added several additional rows of data and messed around with it. Works great, I never would have figured that out.

    Thank you for your help.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Assistance with If And statement

    I've marked this thread as SOLVED for you.
    Next time, select Thread Tools from the links above to mark a thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Assistance Require with IF, ELSE statement
    By Soulj4h in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-28-2013, 12:08 AM
  2. [SOLVED] IF Statement Assistance??
    By PERE in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-19-2013, 09:11 PM
  3. IF Statement Assistance
    By gasguzzler in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-11-2009, 04:50 PM
  4. Assistance with an IF statement
    By dabman in forum Excel General
    Replies: 1
    Last Post: 04-09-2009, 08:31 AM
  5. Replies: 3
    Last Post: 02-15-2008, 05:54 PM

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