Google Product Forums

Re: Range till last value in a row

APL+ Jun 27, 2012 2:05 AM
Posted in group: Google Docs

Categories: Sheets : Ask a "how-to" question : Desktop (specify browser/OS) :

Hi, the behaviour of YEAR() and MONTH() has changed, the long answer is here.

The short answer is to wrap the YEAR() and MONTH() functions in IFERROR().

=ArrayFormula(sumproduct((IFERROR(month('Sheet'!$C$4:$C$499))=A35)*(IFERROR(year('Sheet'!$C$4:$C$499))=$B$34)*('Sheet'!$Q$4:$Q$499))) 

BTW you can use open-ended ranges in this situation, eg $C$4:$C instead of $C$4:$C$499.

HTH
Adam