in source/text/scalc/01/func_aggregate.xhp the example in this line has a mistake: <paragraph id="par_id230920152006414" role="paragraph" xml-lang="en-US"><item type="input">=AGGREGATE(4;1;A2:A9)</item><br/>Returns maximum value for the range A2:A9 =34, whereas <item type="input">=MAX(A2:A9)</item> returns the error Err:511.</paragraph> The second argument should be 2 instead of 1, as the option table above says 1 means "Ignore only hidden rows, nested SUBTOTAL and AGGREGATE functions". The example dataset does have errors, so one needs to use 2 as the second argument, meaning "Ignore only errors, nested SUBTOTAL and AGGREGATE functions".
I believe you, so I set to NEW.
Gabor Kelemen committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/help/commit/?id=f8d42fe73a9a27a17ee421ef63340ac41eeb2539 tdf#99885 Fix example on using the AGGREGATE function