Your question is a bit ambiguous. I'll address what I think you're asking.
What is stored
If you enter something that Excel interprets as a date, it stores it as a date, rather than the actual character string that was input. A date is stored as a number that represents the number of days since a reference date. So the stored value is actually a day count, it doesn't contain or not contain a day depending on whether one was entered.
Everything else (year, month, day of the month, etc.), is derived from that, and the format specification determines what details are displayed. If a month/year date is entered, the only way to store it as a date for it to be a specific date, so Excel assumes the 1st of the month.
Cell query not useful
If Excel interprets an input as a date, the actual input is no longer there to analyze to determine what the user typed (so a function to display the cell text won't help).
However, you might be able to assume what was entered in certain circumstances. I did a quick test in Excel 2007 (I assume this behavior didn't change in subsequent versions).
If Excel assigns a day of the month (because none was entered), it will be the 1st of the month. If all dates for a user are the first of the month and if there is no reason why that should always be the case (i.e., the dates are not defined as always being the 1st), that would be an indication that only month and year were entered.
Conversely, if any dates displayed as month/year contain a day that is not the 1st (check by referencing the cell from another cell and display mm/dd/yy there), that would indicate that the user entered the day and it is being suppressed by the formatting. It is unlikely that a user would enter the day only on dates other than the 1st of the month.
If the cell is preformatted with a date format, date inputs will be displayed in that format. If the cell has a general format, a date input will be displayed in a default date format that shows the same level of information. So, for example, when I typed 07/15
as input to a cell with a general format, it displayed 15-Jul; not identical to what I typed but the same level of information.
If the date input has mixed formats, that would indicate that the cells were not pre-formatted. So dates showing only month and year are likely to have been entered as just month and year.
You have to be really careful here. In the U.S. formatting scheme, if a user just enters a date in the
mm/yy
format, and the two-year date valueyy
falls between1
and31
, Excel actually interprets it as anmm/dd
value in the current calendar year. (e.g.,12-14
is interpreted as 14 Dec 2015, *not* as 1 Dec 2014.) Ifyy
is zero or greater than31
, it will interpretmm/yy
as intended. – hBy2Py – 2015-07-30T16:25:05.583Beware also the
dd-mm-yy
format, as it might behave unexpectedly on you, too. – hBy2Py – 2015-07-30T16:27:34.593Can you clarify your objective? Is it what you ask in your 1st paragraph: determine which cells have a day specified by the user? Or, have you already determined that this is not possible (2nd paragraph), and you are looking for a way to display the actual user entry (or something else)? The mechanism you describe in the 2nd paragraph isn't how the dates are stored (the stored value is the number of days since a reference date; the display is just formatting). – fixer1234 – 2015-07-30T17:36:49.117