Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to create a sheet trigger to select the previous year and the current year but not the current month.
Sample data is as follows
Year month
201511
201512
201601
201602
201603
201604
Selection I would want would be
201511
201512
201601
201602
201603
Try this:
='<' & Max(YearMonth) & '>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), -1), 'YYYYMM'), '##')
Hi Matthew
One idea might be to have 2 actions in your trigger:
First - select the current month in the appropriate field
Second - SELECT EXCLUDED
HTH
Select everything except the most recent month? May be something like this:
='<=' & Date(AddMonths(Max(YearMonth), -1), 'YYYYMM')
So select previous year and the current year
and
SELECT excluded current month?
makes sense
Attached a sample with on open trigger
This selects every single year month, possibly because year month is a string not a date?
Including the most recent one?
yes 201603
maybe because it is a string not a date?
even thought max should still work as is it technically still the MAX number
Trigger action one will select only the current month.
Trigger action two reverses the selection, and therefore excludes the current month.
Might work - but I haven't tried it.
='<' & Max([Year period])
selects everything except 201603
so just need to use that and exclude anything thats 201412 backwards