=SUBTOTAL(3,range_start:range_end)

This worked for me in in LibreOffice 4. I'm not sure what the 3 parameter is for, but it works better than 2. Source: