Average of dates between many years - excel

I have a problem with calculation in Excel of average date (just need day and month) between dates of many years.
I tried this function:
=AVERAGE(IF(MONTH(D5:D56)=9;DATE(2010;9;DAY(D5:D56))))
Apparently, it just gave me average date of year 2010.
Please for any good advice.

Does this array formula do what you want?
=AVERAGE(DATE(2010,MONTH(D34:D56),DAY(D34:D56)))
Be sure to enter it using Ctrl-Shift-Enter.

Related

How to calculate number of days in Excel

I have a date format like 2020-01-17.I would like to calculate number of days till today date. I'm trying it's like
=today() - B2
However it's not working.
Edit
I changed the format to 01/17/2020 and did
=today() - B2
The result comes as 3/23/1900.
This is wrong and I would like to see in number of days.
very simple
Check Out Image enter image description here
I think there are 2 issues that you're seeing here.
The result comes as 3/23/1900.
The reason you're seeing this result as 3/23/1900 is probably because of the format of the cell. Change cell format to number and you should see your result as a number.
Or you can also use the formula with a VALUE formula like so =VALUE(today() - B2)
I would like to calculate number of days till today date
You can always use a simple subtraction of the two dates.
You can also use the DATEDIF function and extract the difference between dates in Years, Months, Days and more. Example: =DATEDIF(today(), B2,"D")
Here is the documentation for this DATEDIF function.
Note: Below is the warning from Microsoft
Warning: Excel provides the DATEDIF function in order to support older workbooks from Lotus 1-2-3. The DATEDIF function may calculate incorrect results under certain scenarios. Please see the known issues section of this article for further details
You can you use the datedif fx link: https://exceljet.net/excel-functions/excel-datedif-function
=DATEDIF(B2,TODAY(),"D")

Excel workdays formula

I have an excel 2010 formula that calculates delivery days on-time, late or early which is good but I need workdays, anyone know how to convert this formula?
=IF(AL16="","",TEXT(AL16-P29,"0 ""Day(s) Late"";0 ""Day(s) Early"";""On Time"""))
Since we do not have your data sheet, it is not easy to understand what the formula is doing but assuming that AL16-P29 part is an ordinary date difference, you should ammend that part to NETWORKDAYS(P29, AL16) in order to find how many workdays are there between these two dates.
As a result your formula s/b:
=IF(AL16="","",TEXT(NETWORKDAYS(P29, AL16),"0 ""Day(s) Late"";0 ""Day(s) Early"";""On Time"""))

Leap year EOM excel formula

I am trying to extract one year from this date 29/02/2020 and should be getting this 28/02/2019, but I am getting this 31/03/2019. I have the following formula =TEXT(EOMONTH(DATE(YEAR(G1)-1,MONTH(G1),DAY(G1)),0),"DD/MM/YYYY"), can someone tell me what I need to add to this formula so that it takes into account leap years.
Would this be okay with you:
=TEXT(EOMONTH(G1,-12),"DD/MM/YYYY")

Excel formula to calculate date difference in years and months

I'm trying to come up with an Excel formula that will calculate the difference in years and months between a date in the past and today.
For example, the following tells me the number of days between a cell and now:
=INT((TODAY()-C2))
But I then need to format that value as Year and Month(s).
Obviously I'm no expert in Excel and appreciate any help!
Thanks in advance,
Dan
Alas, what I did was a simple diff and got a result in year and percent, which will work fine:
=((TODAY())-(D2))/365
The DATEDIF was a total disaster, with really odd, inconsistent results.
Thanks for all the suggestions though!
Looking at the Microsoft Office knowledgebase, I see a YEAR function that may be used:
A1: 1-Jan-2014
A2: 4-Dec-2016
A3: =YEAR(A2)-YEAR(A1) # will yield 2

Excel Calculate the date difference from today from a cell of "7/6/2012 10:26:42"

So I have a cell with 7/6/2012 10:26:42 inputted, I want to show the date difference from today in another cell.
I tried to extract 7/6/2012 with =LEFT(A1, Find(" ", A1, 1) -1) but turned out theres a value error.
The formula works when I make A1 '7/6/2012 10:26:42, however it is not ideal because I have to work with the whole column.
You can use the datedif function to find out difference in days.
=DATEDIF(A1,TODAY(),"d")
Quote from excel.datedif.com
The mysterious datedif function in Microsoft Excel
The Datedif function is used to calculate interval between two dates in days, months or years.
This function is available in all versions of Excel but is not documented. It is not even listed in the "Insert Function" dialog box.
Hence it must be typed manually in the formula box.
Syntax
DATEDIF( start_date, end_date, interval_unit )
start_date from date
end_date to date (must be after start_date)
interval_unit Unit to be used for output interval
Values for interval_unit
interval_unit Description
D Number of days
M Number of complete months
Y Number of complete years
YD Number of days excluding years
MD Number of days excluding months and years
YM Number of months excluding years
Errors
Error Description
#NUM! The end_date is later than (greater than) the start_date
or interval_unit has an invalid value.
#VALUE! end_date or start_date is invalid.
If that's a valid date/time entry then excel simply stores it as a number (days are integers and the time is the decimal part) so you can do a simple subtraction.
I'm not sure if 7/6 is 7th June or 6th July, assuming the latter then it's a future date so you can get the difference in days with
=INT(A1-TODAY())
Make sure you format result cell as general or number (not date)
For the difference between A1 and Today's date you could enter:
=ABS(TODAY()-A1)
which returns the (fractional) number of days between the dates.
You're likely getting a #VALUE! error in your formula because Excel treats dates as numbers.
DAYS(start_date,end_date):
For example:
DAYS(A1,TODAY())
Why don't you just make it easy and simple. If I need to know the number of days between today and say, March 10th, 2015, I can just enter the simple formula.
Lets say the static date is March 10th, 2015, and is in cell O5.
The formula to determine the number of days between today and O5 would be, =O5-Today()
Nothing fancy or DATEDIF stuff. Obviously, the cell where you type this formula in must have a data type of 'number'. Just type your date in normally in the reference cell, in this case O5.
=ROUND((TODAY()-A1)/365,0) will provide number of years between date in cell A1 and today's date
*In all instances the # refers to the cell number
You really don't need the datedif functions; for example:
I'm working on a spreadsheet that tracks benefit eligibility for employees.
I have their hire dates in the "A" column and in column B is =(TODAY()-A#)
And you just format the cell to display a general number instead of date.
It also works very easily the other way: I also converted that number into showing when the actual date is that they get their benefits instead of how many days are left, and that is simply
=(90-B#)+TODAY()
Just make sure you're formatting cells as general numbers or dates accordingly.
Hope this helps.

Resources