Cactus1993
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
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)
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
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.
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
why is that an issue with array formulas since you're looking at the whole column anyway?
Thomas
ASKER
... 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(I F(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
=TEXT(DATEVALUE(LEFT(INDEX
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
Thomas
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),"mm mm, yyyy")
regards, barry
=TEXT(LEFT(LOOKUP("zzz",A:
regards, barry
...similarly you can simplify the end date formula to just
=TEXT(LEFT(A4,12),"mmmm, yyyy")
regards, barry
=TEXT(LEFT(A4,12),"mmmm, yyyy")
regards, barry
ASKER
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
barry's solution worked for me too.
T
T
ASKER
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!!
Have a great week, and thanks to you both again!!
=INDEX(A:A,MAX(IF(LEN(A:A)
Thomas