Return first date of year N in a column (Excel)

时间:2016-10-20 12:54:38

标签: excel date

I want to extract the first date of a given year from a column of dates (see below). E.g. I need a formula that would return 01.06.2015 if I ask for the first Date of the Year 2015 in column A.

Somehow I think this should be really simple but for the life of me I cant find a way to do it... Any and all help would be appreciated! Thx!

My Excel Columne

1 个答案:

答案 0 :(得分:1)

You can use this array formula:

=MIN(IF(YEAR(A2:A16) = 2015,A2:A16))

being and array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.

Or you can use this non CSE formula:

=AGGREGATE(15,6,A2:A16/(YEAR(A2:A16) = 2015),1)

In responce to your comment:

Aggregate is an array type formula. One should not use full column references with array type formulas. They will calculate every row. So for each formula you are doing over 1 million calculations. Instead use:

=AGGREGATE(15,6,A1:INDEX(A:A,MATCH(1E+99,A:A))/(YEAR(A1:INDEX(A:A,MATCH(1E+99,A:A))) = L22),1)

This will grow or contract the dataset to the actual data and not do any extra calculations.