+ Reply to Thread
Results 1 to 11 of 11

LEFT Function to read the first date in a cell

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Smile LEFT Function to read the first date in a cell

    Hi,

    Often use this forum for help with my formulas but this is my first post as a member.

    Version: Excel 2007
    OS: Windows XP

    So here's my query...
    Cell A1 containts: "01/01/1990 to 01/01/2005"

    I want to read the first date in the cell and return "Yes" if the date is before 01/01/2004

    Current formula: "=IF(LEFT(A1,10)="<DATE(01,01,2004)","Yes","No")"

    The formula keeps returning "No" regardless of the dates in the cell.

    Hope this is clear and I havn't forgotten any info!

    Thanks,
    Oscar

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: LEFT Function to read the first date in a cell

    May be:
    =IF(--LEFT(A1,10)<DATEVALUE("01/01/2014"),"Yes","No")
    Quang PT

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

    Re: LEFT Function to read the first date in a cell

    =IF(LEFT(A1,10)+0<DATE(2004,1,1),"Yes","No")
    note date()function uses format year,month,day
    "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

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

    Re: LEFT Function to read the first date in a cell

    Or if your dates are inconsistent

    =IF(LEFT(A1,SEARCH(" ",A1)-1)+0<=DATE(2004,1,1),"YES","NO")

    Note; your "DATE" Function was set up incorrectly. It's year, month, day.
    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

  5. #5
    Registered User
    Join Date
    04-28-2014
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: LEFT Function to read the first date in a cell

    Thank you to all for your quick responses and great advice!

    Although all of your suggestions fixed my problem, I'm still having issues with the overall formula.

    I feel like my conditions require IF,AND,OR,LEFT formulas all together, and I can't seem to fit them all in.

    Basically I need to return 8 different results depending on a set of data.

    I can get it almost perfect, but was having trouble with that date issue, and also the OR function which needs to fit right in the middle.

    I've attached a simplified version so you can clearly see what I'm trying to do. Would really appreciate some help with this. My formula satisfies all conditions, except when it gets to whether there's a value in box1 OR box2. (Will make sense with the attachment)
    The problem is creating 1 formula for everything.

    Thanks again all,
    Oscar
    Attached Files Attached Files

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: LEFT Function to read the first date in a cell

    Could you pls clarify this:
    H2 said : "...has value in either box1 or box2" means box1 (or box 2)>0 ?
    H5 said: "...has no value in either box1 or box2" means box1(or box2)=0?
    I saw that the sample is different :both boxes have value or no value.

  7. #7
    Registered User
    Join Date
    04-28-2014
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: LEFT Function to read the first date in a cell

    H2: Box1 (or box2)>0
    H5: Box1 (and box2)=0

    In the real work sheet sometimes box1 has a value and box2 doesn't have a value, and vice versa.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: LEFT Function to read the first date in a cell

    Another question: is there negative in boxes?
    Last edited by bebo021999; 04-28-2014 at 12:41 PM. Reason: typo

  9. #9
    Registered User
    Join Date
    04-28-2014
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: LEFT Function to read the first date in a cell

    There is never a negative in the boxes, it is always a value higher than 0, so >0 is ok

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: LEFT Function to read the first date in a cell

    How about in F2:
    Please Login or Register  to view this content.
    Drag down

  11. #11
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: LEFT Function to read the first date in a cell

    Place this in F2 and drag down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by playaller; 04-29-2014 at 06:56 PM.


    Shelton A.
    If Helpful, Add Reputaion!

+ 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. Date format to read YYYY/MM/DD in function box
    By PatriciaB in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2014, 10:52 AM
  2. [SOLVED] Move date shown in cell to new cell directly left once date has passed
    By jamieswift1977 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-16-2013, 11:23 AM
  3. Combining Mid Right Left with DATE function
    By marshymell0 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-11-2013, 03:14 PM
  4. Replies: 15
    Last Post: 05-16-2010, 12:20 AM
  5. Read left side cell value to the commented cell
    By gsr in forum Excel General
    Replies: 2
    Last Post: 05-09-2010, 05:55 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