+ Reply to Thread
Results 1 to 4 of 4

If statment looking up multiple cells with date values

Hybrid View

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    If statment looking up multiple cells with date values

    I am not where to even start with this. Result I need a 4 digit year for figure out age for the equipment.
    A2= Purchase date as Jul 15, 2001 12:00:00Am
    B2= Install Date with same format as purchase date
    C2 = Manufactured Year = yyyy as 1976
    D2 = PO # as 73-4801 (first 2 digit represnt as year 1973)

    I need to create if statement for results to be 4 digit year in seperate column. First if there is manufacture year then give me the year, if not then look at column install date and if there is date in column install date then give me the year (from the long date i only need 4 digit year), if there is no year in manufactured year or install date then lookin at purchase date and give me the year from that column, if none of the first 3 has information then look at PO # and give me the first too digits of PO number.

    I Hope this makes sense. I am not sure where to begin creating this formula. I am really new to if statments so please help!

    I have attached an 4 different senario's that i am facing.

    Thank you
    RG
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If statment looking up multiple cells with date values

    Try something like this

    =IF(F2>0,F2, IF(ISNUMBER(E2), YEAR(E2),IF(ISNUMBER(A2), YEAR(A2), IF(LEFT(G2,2)+0>14, 19&LEFT(G2,2), 20&LEFT(G2,2)))))+0
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: If statment looking up multiple cells with date values

    Your file doesn't match the column structure you give in your post.

    Based on the attached file structure, try:
    Formula: copy to clipboard
    =IF(F2>0,F2,IF(E2>0,YEAR(E2),IF(A2>0,YEAR(A2),1900+LEFT(G2,2))))
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: If statment looking up multiple cells with date values

    Both the given formula above worked great for this. Thank you so much ChemistB & Olly. You guys were very quick. Thanks Again

+ 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. Replies: 2
    Last Post: 06-06-2012, 10:59 PM
  2. IF/THEN with two column values for IF statment
    By Broccoli in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-15-2012, 06:01 PM
  3. If statment with values only
    By Rick-O-Shay in forum Excel General
    Replies: 2
    Last Post: 01-05-2010, 07:53 PM
  4. [SOLVED] Help with If statment to compare values
    By Vika in forum Excel General
    Replies: 2
    Last Post: 08-15-2005, 12:05 AM
  5. Help with If statment to compare values
    By Vika in forum Excel General
    Replies: 5
    Last Post: 08-14-2005, 01:05 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