Q:

Excel #Value error when using DATEVALUE function

In cell A2 I have 7/21/2014 12:44:36 PM
When I use DATEVALUE(LEFT(A2;FIND(" ";A2)-1)) I get the error #VALUE.
When I use LEFT(A2;FIND(" ";A2)-1) I get 7/21/2014.
What do I need do that function DATEVALUE(LEFT(A2;FIND(" ";A2)-1)) to return just the date?

A:

DATEVALUE() is designed to make a Date out of plain text. Your cell is currently a Date/Time, which is a numeric value. I recommend using one of the following solutions to get the date from the cell.
Using DATE()

This is the cleanest option and the method that I would recommend.
=DATE(YEAR(A2),MONTH(A2),DAY(A2))

YEAR() gets the Year value from the cell, MONTH() gets the Month value, and DAY() gets the Day value. The DATE() function takes a Year, Month, and Day value, so by passing them into DATE() we can get the Date value from A2.
Using INT()

If we look at the numeric value of your Date in A2, we see that it is 41841.5309722222. The whole portion of the number (41841.) is the date and the decimal portion (.5309722222) is the time. So if we take INT(A2) to convert this value to an integer, we will lose the decimal portion so that all that remains (41841) is the date. So this is our formula for using INT()
=INT(A2)

The same idea can be accomplished with ROUNDDOWN(A2,0) or =FLOOR.MATH(A2) or =FLOOR(A2,1).
Using DATEVALUE()

While the first solution is the cleanest, there is a way to do this with DATEVALUE() that involves converting the cell into Text first. The TEXT() function takes a value and a format string, so we format the cell value as Text as follows
=TEXT(A2,"yyyy-mm-dd")

And this gives us
2014-07-21

We then pass that result into DATEVALUE()
=DATEVALUE(TEXT(A2,"yyyy-mm-dd"))

You will need to format the result as a date.
Using LEFT() and DATEVALUE()

Based on this Stackoverflow question that I found, it appears the issue could be a result of inconsistent formatting, so you might try this solution
=DATEVALUE(LEFT(A2,FIND(" ",A2)-1))

I have included my results with this and the other methods in a screenshot below. You can see by my use of the TYPE() command below the value that I tested this on both a number and text.
Results

Formatting

I'm assuming you want just the date for calculation purposes, but if you just want to display the date, you can format the cell to only show the date and ignore the time element although the time element will still be present in the cell. I'm assuming you know about this, but since you didn't specify, it is a possible solution.

