Missing date formula syntax

normpam

Active Member
Joined
Oct 30, 2002
Messages
360
If A2 has a date like 11/30/16, and E2 has 03/31/17, then a formula: =A2>E2 returns false. But, if if I type =A2>03/31/17, it returns 'True', which is not correct. I had the same issue using a date within a conditional formatting formula. Isn't there a syntax to use besides using the =Date() syntax?

Thanks!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
If you want to use a formula, you can enter 3/31/17 in say A1 and the formula becomes: =A2>A1, which returns FALSE or you can use the serial number for 3/31/17 which is 42825: =A2>42825 if you don't want to use the DATE function.
 
Upvote 0
Thanks Tetra... I thought I saw once a long time ago that dates should be surrounded with # signs, but I also tried quotation marks, but it doesn't work without your extra +0. Why does the +0 make it work??
 
Upvote 0
Dates in Excel are numbers.
"03/31/17" is a text string.
The +0 converts the text string into a number.
 
Upvote 0
Dates in Excel are numbers.
"03/31/17" is a text string.
The +0 converts the text string into a number.

Thanks! Just got back to this one today. Two more ideas.... First, I found that multiplying by 1 also works. Also, I could almost swear that years ago I was able to work with dates within a formula by using the # sign before and after the date.... was there every another syntax in Excel that worked?
 
Upvote 0
I could almost swear that years ago I was able to work with dates within a formula by using the # sign before and after the date.... was there every another syntax in Excel that worked?
That is a common way of referencing dates in Access queries...
 
Upvote 0
I could almost swear that years ago I was able to work with dates within a formula by using the # sign before and after the date.... was there every another syntax in Excel that worked?
#mm/dd/yyyy# is a way of entering hard-coded dates in VBA.
Code:
Dim Dte as Date
Dte = #10/28/2017#
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top