You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openoffice.apache.org by johnny smith <ka...@krovatka.su> on 2012/12/08 18:04:56 UTC
Re: countif on multiple items - date test
On Fri, 07 Dec 2012 08:20:45 -0000, DaveInDenver <dw...@hotmail.com> wrote:
> How can I modify the formula to test for a date?
>
> If Column A were dates for example.
> A1 = 08/01/12
> A3 = 08/15/12
> A9 = 09/01/12
>
> How do I select for Aug 2012?
i've found 2 ways, both not ideal. the first is:
B1 = 08/01/12
B2 = 09/01/12
B3 = COUNTIF(A1:A9;">="&B1)-COUNTIF(A1:A9;">="&B2)
--which looks a bit like a workaround, as i was not able to find a way to apply a regular AND statement. however, this one is the most compatible, since it handles different date formats automatically.
the second option is to use wildcards:
B1 = COUNTIF(A1:A9;"08/[0-9]{2}/12")
or
B1 = COUNTIF(A1:A9;"August [0-9]{1,2}, 2012")
--which depends greatly on the locale settings and thus lacks compatibility when loading on a different machine.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org