Link to home
Start Free TrialLog in
Avatar of Cactus1993
Cactus1993Flag for United States of America

asked on

Begin and End Dates

Hi:

Attached is an Excel spreadsheet with a column of dates.

I need a formula for the “Begin Period”, similar to the one I have in the spreadsheet for the “End Period”. The “Begin Period” is based on the column of dates and is at the bottom of the column, but that column varies with number of dates and rows each time the report is run.  

I need the result in the format, for example, "December, 2010"

Keep in mind the column of dates will always be a different number of rows. In one reporting period there may be 50 rows of dates, in others it may be 200 rows of dates. The first row will always be fixed but the last row, obviously, will always be different based on the varying number of dates.

Currently, for the "End Period" formula I have, and it works:

=TEXT(DATEVALUE(LEFT(A4,3)&" " &MID(A4,FIND(" @",A4)-4,4)),"mmmm, yyyy")

I just need the Begin Period formula for the month & year, but am not sure how to do this with varying numbers of rows of dates.

Thank you!

 Dates-2.xlsx
Avatar of nutsch
nutsch
Flag of United States of America image

Here is an array formula for that, to be entered with Ctrl+Shift+Enter
=INDEX(A:A,MAX(IF(LEN(A:A)>0,ROW(A:A),0)))

Thomas
Avatar of Cactus1993

ASKER

Nutsch:

I'd rather not use arrays, due to the fact the number of rows of dates will constantly be changing. Is there a way to do this without using an array?  Thanks.
>due to the fact the number of rows of dates will constantly be changing

why is that an issue with array formulas since you're looking at the whole column anyway?

Thomas
... plus, it only returns #VALUE! when entered into cell B1 on the example spreadsheet and adjusted to begin at cell A4 (the beginning of the column of dates.)
I insist on
=TEXT(DATEVALUE(LEFT(INDEX(A:A,MAX(IF(LEN(A:A)>0,ROW(A:A),0))),12)),"MMMM, YYY")

as in your attached, updated sample file.

What part doesn't fit?

T


Copy-of-Dates-2.xlsx
Warning, the formula will return #VALUE if it's validated as a standard formula, ie with Enter. You need to enter the cell (using F2) and validate with Ctrl+Shift+Enter to have it work as an array formula. When you do this, you will see {} appear around the formula in the formula box.

Thomas
Avatar of barry houdini
Assuming that you only have those dates in column A then you can use this non-array version

=TEXT(LEFT(LOOKUP("zzz",A:A),12),"mmmm, yyyy")

regards, barry
...similarly you can simplify the end date formula to just

=TEXT(LEFT(A4,12),"mmmm, yyyy")

regards, barry
Nutsh and Barry:

The array formula Nutsch offered did in fact work ... I had to change a bit of the formula as my example sheet was just a subset of my larger spreadsheet. I would like to use non-array formulas, simply because I'm not familiar with arrays and was under the impression I had to change them often when the number of cells, rows, columns etc changed. Using the Begin Date, non-array formula in my larger spreadsheet, I got FALSE as a return, but the simplified end date formula did work. Am I missing something with the Begin Date? Is "zzz" exactly what I should enter?  In my larger spreadsheet, all the dates begin in cell B9 and run down the column, with no other type of entries within the column.Again, the number of rows and dates varies, but nothing else but those dates are entered from cell B9 down. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
barry's solution worked for me too.

T
Guys -- Thank you so much. Works perfectly. I had copied the formula incorrectly and that was apparently the problem. Nutsch, thank you so much for your help, but with my unfamiliarity with arrays I'm more comfortable with Barry's non-array formula, and thank you Barry for explaining it in detail as you did.

Have a great week, and thanks to you both again!!