since STDEV is not supported under ARRAYFORMULA there is either draggable solution:
or hardcoded solution:
but neither of them is dynamically scalable so is there any workaround?
from a quick google search, it looks like no one dared to dream of such lengths
data sample:
b 5
a 1
a 2
b 5
a 1
desired result:
a 0.5773502692
b 0




the math says that standard deviation can be achieved as:
if we substitute for formulae we get:
knowing the above we can easily convert it into a multidimensional array... let's start with the first query where we pivot labels:
removing labels:
calculating the average:
removing labels:
for subtraction, we need to exclude empty cells so we use
IF:and raise it on the 2nd power:
now we can sum it up per column with
MMULTorQUERYagain:to make it more dynamic we can construct query selection with
SEQUENCE:next is division by count:
then square root:
now we just add back labels:
and transpose it:
it works, but we can do better... simple
IFstatement will do:but to make it fast and smart we need some tweaks to counter empty cells and unsorted dataset:
we add errors:
subtract the average:
raise on the 2nd power:
remove errors with
IFNAand sum it:divide by count-1:
take a square root:
transpose it and add back labels: