компактный режим:
={"select Interface", L1;
QUERY(A2:H, "select A,count(A) where D='"&L1&"' group by A label count(A)''");
QUERY(A2:H, "select B,count(B) where D='"&L1&"' group by B label count(B)''");
QUERY(A2:H, "select C,count(C) where D='"&L1&"' group by C label count(C)''");
QUERY(A2:H, "select E,count(E) where D='"&L1&"' group by E label count(E)''");
QUERY(A2:H, "select F,count(F) where D='"&L1&"' group by F label count(F)''");
QUERY(A2:H, "select G,count(G) where D='"&L1&"' group by G label count(G)''");
QUERY(A2:H, "select H,count(H) where D='"&L1&"' group by H label count(H)''")}
с маркировкой:
=IF(K1<>"", {
QUERY(A1:H, "select A,count(A) where D='"&K1&"' group by A label count(A)''", 1);
QUERY(A1:H, "select B,count(B) where D='"&K1&"' group by B label count(B)''", 1);
QUERY(A1:H, "select C,count(C) where D='"&K1&"' group by C label count(C)''", 1);
QUERY(A1:H, "select E,count(E) where D='"&K1&"' group by E label count(E)''", 1);
QUERY(A1:H, "select F,count(F) where D='"&K1&"' group by F label count(F)''", 1);
QUERY(A1:H, "select G,count(G) where D='"&K1&"' group by G label count(G)''", 1);
QUERY(A1:H, "select H,count(H) where D='"&K1&"' group by H label count(H)''", 1)}, )
примечание: зеленый фон и полужирные метки могут быть автоматически установлены с помощью условного форматирования
расширенный режим:
=ARRAYFORMULA(REGEXREPLACE(TO_TEXT(QUERY(A1:H,
"select A,count(A),B,count(B),C,count(C),D,count(D),
E,count(E),F,count(F),G,count(G),H,count(H)
where D='"&K1&"'
group by A,B,C,D,E,F,G,H", 1)), "^count.*", ""))