Enter year alone in cell.

jblevins

Active Member
Joined
Sep 2, 2013
Messages
250
Office Version
  1. 2003 or older
I want to enter the year only in a cell and use it in the DATE function, but it always returns 1905.
Excel Formula:
Enter 2023 in A1 as text
DATE(YEAR(A1),MONTH(B1),DAY(C1))
:
 
The workbook that I am working on is a little complicated with several defined names and is capable of handing a yearly calendar and storing information entered into dates for any year or month. The issue was displaying the information for the year that is entered, basically it is for appointments, my problem is that I will not leave it alone, I keep making changes to it.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Upvote 0
Yes I understand how Excel stores and sees dates, but the issue I had was that I had the cell formatted wrong causing the error.
 
Upvote 0
@Joe4 So if you just enter the value as a text string and then apply the YEAR function to it , should that then work as below or am i missing something in his question.
Book1
ABCD
1YearMonthDayDate
219903101/03/1990
319104202/04/1910
420147303/07/2014
520188404/08/2018
6202210505/10/2022
720254606/04/2025
820306707/06/2030
920459808/09/2045
Sheet1
Cell Formulas
RangeFormula
D2:D9D2=DATE(A2,B2,C2)
In the example you posted, you are NOT apply the YEAR function to anything (look at your formulas, nowhere are you using the YEAR function).
That is what I already showed in my first reply, before I realized that what you assumed/posted (which is what I also initially assumed) is NOT actually the data structure that the user has (they are pulling MONTH and DAY from an existing date). So they are pulling year from a number/text entry, and the rest from an existing date.
 
Upvote 0
Yes I understand how Excel stores and sees dates, but the issue I had was that I had the cell formatted wrong causing the error.
Note that if you have a number entered as Text that you want to treat as a number, one simple way to convert it is to simply add zero to it to coerce it to become a number, i.e.
Jul!F8+0
If it already is a number, adding zero to it will not hurt it/change its value.
 
Upvote 0
I understand it all, I also understand that serial of the date starts with 1900. I appreciate the help, have a great day and God bless.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,853
Members
449,051
Latest member
excelquestion515

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