Basic Reporting Part VII FAQ: Is there a formula that will automatically produce a header that says the month name and year for today's date?
Yes.
You can create a formula for the cell you want this displayed. There are a number of functions that will be needed.
Today() -> This gives today's date (1/6/2016)
Year() -> This takes a date as a parameter and it will return just the year. eg. Year(Today()) -> 2016
Month() -> Gives the month portion of a date Month(Today()) -> 1
MonthName() -> Give this function a number and it returns the month for that number as a name. eg. MonthName(1) -> Januaray
& -> This is used to "concatenate strings". Meaning it'll take 2 sets of words/functions and add them together. e.g. "Month" & "Year" -> "MonthYear"
' ' -> this will add a space. Anything in single quotes is called a Literal Value, and is exactly what it is. So in this case a space, which we need for formatting.
So putting that all together, your formula for your header cell is: MonthName(Month(Today())) & ' ' & Year(Today())
Which would result in January 2016 instead of 1/6/2016 as an example.
Also make sure to set the formatting on the Cell to Text, or it'll try to be helpful and revert back to a date stamp.
Comments
0 comments
Article is closed for comments.