+ Reply to Thread
Results 1 to 10 of 10

how to subtract dates with text in the

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    jackson,ga
    MS-Off Ver
    2010
    Posts
    13

    how to subtract dates with text in the

    I added a pic to clarify A2 comes from a vlookup so im trying to figure out how to either 1.Return the date only from the vloopup or 2. subtract A2-B2
    Attached Files Attached Files
    Last edited by bell_man; 03-17-2016 at 01:54 PM. Reason: clarify

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: how to subtract dates with text in the

    Or Maybe a vlookup formula to only return the date and not the text character?
    That sounds like a better option,otherwise you will need a formula to 1st remove the text, then do the subtraction. In fact, if you are using vlookup to find the dates, why not use the same thing for the calc, just leave out the text?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: how to subtract dates with text in the

    Please Login or Register  to view this content.
    This simple formula works if there is only one character there

  4. #4
    Registered User
    Join Date
    07-03-2014
    Location
    jackson,ga
    MS-Off Ver
    2010
    Posts
    13

    Re: how to subtract dates with text in the

    edited the original post

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: how to subtract dates with text in the

    This should do what you need...
    =B2-DATEVALUE(LEFT(A2,LEN(A2)-1))

    (note: there is not 31 days in Feb :0 )

  6. #6
    Registered User
    Join Date
    07-03-2014
    Location
    jackson,ga
    MS-Off Ver
    2010
    Posts
    13

    Re: how to subtract dates with text in the

    that did it you are the man

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: how to subtract dates with text in the

    You have an impossible date in B2. What should it be?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: how to subtract dates with text in the

    Ok just inserting a real date:
    Select column B and the click on the Data tab, Text to columns, click NEXT NEXT , select DATE MDY, click finish. This will convert the value to a real date.

    Choose the formula to give the number that you are looking for.
    Enter this in C2 to give the number of dates BETWEEN the first and last dates but not including either date.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This includes both the start and end dates
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This includes the last date but not the first.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: how to subtract dates with text in the

    B2 is also something that isn't a date. I can't determine exactly what it is but this will straighten it out. (works with dd/mm/yyyy date format)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This should work with date format of mm/dd/yyyy
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    07-03-2014
    Location
    jackson,ga
    MS-Off Ver
    2010
    Posts
    13

    Re: how to subtract dates with text in the

    sorry about the date. It works when you use the an actual date.

+ 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. [SOLVED] Subtract the two latest dates
    By keis386 in forum Excel General
    Replies: 1
    Last Post: 03-06-2014, 10:48 AM
  2. [SOLVED] How to subtract the dates
    By uttam.mothe in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-06-2013, 08:43 AM
  3. Subtract dates in same column
    By jimde in forum Excel General
    Replies: 10
    Last Post: 01-01-2013, 09:35 PM
  4. how to subtract dates that are not null
    By jgomez in forum Excel General
    Replies: 2
    Last Post: 09-20-2011, 05:57 PM
  5. Subtract dates d:hh:mm
    By Allardin in forum Excel General
    Replies: 14
    Last Post: 10-24-2008, 08:39 PM
  6. Subtract two dates
    By Joe in forum Excel General
    Replies: 2
    Last Post: 02-07-2006, 11:10 PM
  7. How do you Subtract dates in VBA
    By postlp60 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2005, 06: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