Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I have to do a query that increments automatically the date year by year. For example I use this formula:

=INDEX(query('Scheda Intervento'!C3:K14;"select sum (K) where (F >= date '2013-01-01' and F <= date '2013-01-31' and C = '" & A3 &"')");2;1)

But every year I have to change the date in 2014 , 2015 etc.

See example file: year by year. The formula is in the sheet "riepilogo totale ore , date, compensi operatore" in cell C2.

share|improve this question
    
Did my solution with the INDEX function work? –  Jacob Jan Tuinstra Apr 23 '13 at 19:30
1  
yes thank you so much –  jack1986 Apr 24 '13 at 14:08
    
Perhaps you can mark it as such. Read How to Ask on how to mark a answer –  Jacob Jan Tuinstra Apr 24 '13 at 15:58
add comment

1 Answer

Try this

=INDEX(query('Scheda Intervento'!C3:K14;"select sum (K) where (F >= date '"&YEAR(NOW())&"-01-01' and F <= date '"&YEAR(NOW())&"-01-31' and C = '" & A3 &"')");2;1)

I used the function YEAR(NOW())

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.