excel - Including start year and end year in YEAR calculations -
for calculation i'm trying perform 1 year = 1 season , data have start year , end year.
so 1952 1953 needs add 2 (seasons) if use =year(a1)-year(a2)
result 0
- there simple way include start year , end year value in these calculations?
it looks have found problem , rectified it. benefit of others might have found thread, why behaving ways was.
background - excel (and many other applications) treat dates 1 every day past dec 31, 1899. today happens 42,079. time decimal portion of day 42,079.75 mar 16, 2015 06:00 pm.
you had years numbers in a1:a2; not full dates. using 1-per-day formula, 1952 may 5, 1905 , 1953 may 6, 1905. if peel out year of each of year()
function, subtracting 1905 1905; resulting in zero.
the solution either type full dates a1:a2 , format cells yyyy display 1952 & 1953 retain full date nature e.g. =abs(year(a1) - year(a2)) + 1
, or use years numbers , discard year()
function altogether, e.g. =abs(a1 - a2) + 1
spanned (inclusive) number of seasons.
Comments
Post a Comment