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
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
Last edited by bell_man; 03-17-2016 at 01:54 PM. Reason: clarify
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?Or Maybe a vlookup formula to only return the date and not the text character?
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
This simple formula works if there is only one character therePlease Login or Register to view this content.
edited the original post
This should do what you need...
=B2-DATEVALUE(LEFT(A2,LEN(A2)-1))
(note: there is not 31 days in Feb :0 )
that did it you are the man
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
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:Please Login or Register to view this content.
This includes both the start and end dates
Formula:Please Login or Register to view this content.
This includes the last date but not the first.
Formula:Please Login or Register to view this content.
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:Please Login or Register to view this content.
This should work with date format of mm/dd/yyyy
Formula:Please Login or Register to view this content.
sorry about the date. It works when you use the an actual date.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks