SOLVED

I'm unable to subtract these two properly formatted dates

Copper Contributor

I have two date columns, but I'm unable to do a simple subtraction. I get the #VALID error bar as an output. I've tried highlighting the two columns of numbers that have dates and converting them to dates. 

 

Here's an image of what the data looks like: https://imgur.com/a/DjY7sMx   As you can see in the formula bar, the numbers show up exactly like mm/dd/yyyy . 

 

I also found out that the date columns don't sort from A-->Z or Z-->A properly. Here's an image of what happens when I try: https://imgur.com/RKeRwXK   I noticed that it's sorting by only the months, and it ignores the dd and the yyyy. 

 

5 Replies
best response confirmed by VI_Migration (Silver Contributor)
Solution

@Sales_Orchestrator 

The values look like dates, but they are actually text values. A tell-tale sign is that they are left-aligned.

Select a column with text dates, then click Text to Columns on the Data tab of the ribbon.

Click Next>> twice.

In step 3, select date and make sure that MDY is selected. Then click Finish.

Repeat for each column with text dates.

@Hans Vogelaar 

Thanks! That worked perfectly. 

@Hans Vogelaar 

 

Out of curiosity, why didn't my solution of converting the dates by highlighting the column and using Format Cells --> Date work? 

 

I thought that by changing the format of the data, that should work, but it didn't in this case. Your solution worked perfectly. 

@Sales_Orchestrator 

If Excel sees a value as text, the number formatting will be ignored.

Text to Columns converts the values to 'real' dates.

1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution

@Sales_Orchestrator 

The values look like dates, but they are actually text values. A tell-tale sign is that they are left-aligned.

Select a column with text dates, then click Text to Columns on the Data tab of the ribbon.

Click Next>> twice.

In step 3, select date and make sure that MDY is selected. Then click Finish.

Repeat for each column with text dates.

View solution in original post