Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
On entering a sheet I would like it to be automaticly set for the period of the two previous months as from today. I have used:
(in the textfield search I wrote:)
=MONTH(TODAY())-1 (that works, but only for one month). How can I expand my range with 2 months?
Try this in your search string:
='(' &text(month(AddMonths(today(),-2)))&'|'&text(month(AddMonths(today(),-1)))& ')'
MONTH(TODAY())-2 didnt work?
Hi Partner
The string works, but the result is that it gives the month before the previous month .
Today the monthnumber = 8 , and I would like to see monthnumber 6 AND 7 on entering the sheet.
I would think this way
=AddMonths(MONTH(TODAY()), -2)
='>=' & AddMonths(MONTH(TODAY()), -2) & '<' & MONTH(TODAY())
A more robust expression will be :
=ADDMONTHS(TODAY(),-2)
Addmonths() able to capture cross year while month() cannot work in that manner.
For example if we currently at Jan 2019,
Addmonths(today(),-2) can back track till Nov 2018, while month(today())-2 will show null.
Thanks and regards,
Arthur Fong
Hi again
thanks 4 all the effort but both solutions still give zero result. Seems to working for only 1 month
May be there is no data for one month?
Try this in your search string:
='(' &text(month(AddMonths(today(),-2)))&'|'&text(month(AddMonths(today(),-1)))& ')'
Remove text() if your month dimension is a date or num field.
Thanks.
Hip, hip Hooray!.....
That's the one! Thanks a 1.000.000