Convert Whole Digit to Date Format - excel

I am trying to convert the Day column to a standard date format. 1 for Nov 1 (current month), 2 for Nov 2, and so on. Would be nice if the formula will display the current month. The format for the Day column is in general.

Alternately, use =A2+43039 and format cells as Custom: d-mmm
Also possible to use =A2+"10/31/2017" to make it clearer what you're doing in the formula.
However, if you want it to update with whatever the current month and year is, Ralph's answer is probably best.

Copy the following formula into cell B2 (if that's your Date column and Day is in the A column) and then copy it down:
=DATE(YEAR(TODAY()),MONTH(TODAY()),A2)

Related

Excel - count days between two dates per year

I am trying to get the number of days per year between two dates.
The results should look somehow like the following picture
The range between the 2 dates in the 2021 year has 301 days and in the 2022 year has 94 days.
Put this in C2 and copy over:
=MIN(DATE(C1,12,31),$B$2)-MAX(DATE(C1,1,1),$A$2)
Your question isn't entirely easy to understand but what you don't know is in plain sight: Excel represents dates as integer numbers where Jan 1, 1900 is the first day (= 1) and all days from then till now have a unique number. Today is 44261. Tomorrow will be 44262.
Therefore the difference between dates equals [End date] - [Start date], where only one of these two dates is included in the count. [Tomorrow]-[Today] = 1, not 2.
When a worksheet cell is formatted as General Excel will automatically change that format to whatever Excel thinks you have probably entered. If you enter what Excel recognizes as a date the cell format will be changed to Date and if the way you entered the date was by function, such as =TODAY() the cell will display "6/3/2021" using the date format specified in your Windows International settings.
But if you manually change the cell format back to General or Number the display will change to 44262. That's the way you can test if your cell contains a "true" date, with which you can do calculations, or a "fake" date, which is just a text string which is nice to look at but otherwise useless.

How to get first month of the year from TODAY Function in Excel?

In a excel sheet range A1:A12, I need months like:
Jan 2020 to Dec 2020 for current year.
and Jan 2021 to Dec 2021 for next year. and so on. Automatically.
I google it but did not find any suitable result.
Plz help me and ignore my weak English and grammar.
Thank You.
Let's say you want a real date, using the 1st of each month (you can then format the cells to just show mmm yyyy or whatever other format you like). In your first cell enter:
=DATE(YEAR(TODAY()),ROWS($A$1:$A1),1)
and copy it down. If you actually want the month as text, just wrap that in the TEXT function:
=TEXT(DATE(YEAR(TODAY()),ROWS($A$1:$A1),1),"mmm yyyy")
Note that the DATE function will happily adjust the year if you pass a month number greater than 12.
Use below formula-
=TEXT(DATE(2020+INT(ROW()/13),MOD(ROW(),13)+INT(ROW()/13),1),"mmm-yyyy")
To get This using =TODAY() function you have to use 2 cells.
Let's use A1 and B1 as the 2 cells.
In A1 you will display today's dat as dd/mm/yyyy
=TODAY() type this in A1
In B1 you will convert it to month and year.
=TEXT(A1,"mmm-yyyy") type this in B1
But using this method you can only get this month.

Excel Date table to determine next Bi-annual date from Input date

I am creating a Table in excel to help determine what the Bi-annual dates would be from an input date.
Example: If the start date of an agreement is 9/1/2017 and Ends 8/31/2018, the Bi-annual dates would be 2/28/18 and 8/31/2018. Dates of service would be 2 months before the end of the agreement period, and six months before the second service date (so 6/30/2018 and 12/31/2017 respectively).
Formula for this:
=IF(ISBLANK(O3), "",IF(EOMONTH(A1, 0)=EOMONTH(O3, -2), "BIANNUAL", IF(EOMONTH(A1, 0)=EOMONTH(O3, -8), "BIANNUAL", "")))
Where A1 refers to January, B1 would be February, and so on thru to December (L1). O3 is the Agreement End Date box, and will be static on the sheet. This formula work perfect for me.
What I am trying to get is a formula for the cells at the top that list the months (Jan-Dec). I need a formula that will put the date as 1/31/2018 for Jan, 2/28/2018 for Feb, 9/30/2017 for September (for the current year since September has not passed). The actual day needs to be the last day of the month, and if that month has passed, then the year should be for next year. I have been playing with the DATE function, but cannot get it nailed down.
What I have so far - January 2018:
=DATE(YEAR(TODAY()+365), MONTH(42766), DAY(EOMONTH(42766, 0)))
This works, but not each month will be in 2018. I need the year to change only after the month has passed.
I feel like I'm either over complicating things, or I need a way more complex formula. Please help.
In A1 place the following formula and copy right to L1 or as far as you need to go
=EOMONTH($O$2,COLUMN(A1)-1)
It will display the end of month dates starting with the starting month of the contract and increasing by 1 month for each column you move right.
In the image below, it is the same formula in row 1 and row 2. Row one I choose custom format instead of date and set the custom format to mmmm. 4 m's will give you the full month, and 3 m's will give you the 3 starting letters of the month.
I actually figured this out this morning just playing with the IF function. My goal was to have the sheet update itself without having to change the dates every time your open it. So that the file could be shared with others and all you would have to enter is the end of the contract date, and it will list out Biannual, Tri-annual, and Quarterly months (see image).
Formula:
=IF(DATE(YEAR(TODAY()), MONTH(42766), DAY(EOMONTH(42766, 0)))<TODAY(), DATE(YEAR(TODAY()+365), MONTH(42766), DAY(EOMONTH(42766, 0))), DATE(YEAR(TODAY()), MONTH(42766), DAY(EOMONTH(42766, 0))))
Where I used the serial for each month (in this case 1/31/2017, as I didn't need to worry about the year)
Results

Create a column with calendar date in Excel

I have a sheet in Excel, what I want is, to create a column, where each row starts with a specific date, for example, "3 april 2017". Then, when I drag and scroll bottom I want it to increase by one day.
So, basically, I want to create a sheet where each row starts with a specific date, where the first date is equal to now date, and next row is today date + 1 day.
I'm not very keen in Excel and I tried =WEEKDAY and =DAYformulas, but I could not get what I want.
Is there any formula I can use to easily achieve this task?
As discussed in the comments, Excel stores dates as numbers so to add a day to a date you simply need to add one to it:
=A1+1
... for example, when the original date is in cell A1.
To format this as you require, use the following custom format string:
d mmmm yyyy

How to turn column of four digit years entered in general format into a date column or yyyy simply

How to turn column of four digit years entered in general format into a date column or yyyy simply? I have a column of two digit months 1-12 and a column of four digit years and then found I should have used a date format. I would like two convert these hundreds and hundreds of entries into a useful date format with a formula or minimum of fuss or programming logic so I can perform useful analysis on the data and don't have to manually re-enter large amounts of data.
I have excel 2007
Thanks for any help
Use on of the following formulas in an unused column's row 2,
=DATEVALUE("1/1/"&A2) '<~~ 01-Jan-2015 when 2015 in A2
=DATE(A2, 1, 1) '<~~ 01-Jan-2015 when 2015 in A2
Format the cell (Ctrl+1, Number, Custom) as yyyy then fill down or right as necessary.
Do not use the YEAR function. For 2015, you will get 1905. This is because dates are 1 for every day past 31-Dec-1899 and 07-Jul-1905 happens to be the 2015th day since 31-Dec-1899.
I believe this is what you are looking for, where A1 would be the location of the cell that you have stored a four digit year as text:
=TEXT("1/1/" & A1,"yyyy")

Resources