FTR 表公式:
=ARRAYFORMULA(REGEXREPLACE(TO_TEXT(QUERY(QUERY({QUERY(
{InputData!D3:D&"♦"&InputData!C3:C, InputData!B3:F, InputData!D3:D&
IF(InputData!D3:D="",,"♥"&TEXT(InputData!D3:D, "dd/mm/yyyy"))},
"select Col1,Col4,Col3,Col7,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5 != 'lost'
group by Col1,Col4,Col3,Col7"),
IFNA(VLOOKUP(INDEX(QUERY({InputData!D3:D&"♦"&InputData!C3:C, InputData!B3:F},
"select Col1,Col4,Col3,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5 != 'lost'
group by Col1,Col4,Col3"),,1),
QUERY({InputData!D3:D&"♦"&InputData!C3:C, InputData!B3:F},
"select Col1,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5 != 'lost'
and Col6 = 'yes'
group by Col1"), 2, 0))},
"select Col4,Col3,Col6/Col5"),
"select Col2,max(Col3)
group by Col2
pivot Col1
label Col2'FTR%'
format max(Col3)'#.00%'")), "(\d+♥)", ))
一个公式中的所有 3 个表格完全动态:
=ARRAYFORMULA({TRANSPOSE(QUERY(TRANSPOSE(QUERY(IFNA(
HLOOKUP(INDEX(TRANSPOSE(QUERY(InputData!A3:F,
"select D,count(B)
where D is not null
and year(D)="&C1&"
and E!='lost'
group by D
pivot C
label D 'NO OF ISSUES'")), 1), TRANSPOSE(QUERY({InputData!A3:F},
"select Col4,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5!='lost'
and Col6 = 'yes'
group by Col4
pivot Col3
label Col4 'NO OF ISSUES'")), ROW(A1:A10000), 0)),
"where Col1 <> '#REF!'")),
"format Col1'm/d/yyyy'"));
SPLIT(REPT(" ♠", COLUMNS(TRANSPOSE(QUERY(InputData!A3:F,
"select D,count(B)
where D is not null
and year(D)="&C1&"
and E!='lost'
group by D
pivot C
label D 'TOTAL OPPORTUNITIES'")))), "♠");
TRANSPOSE(QUERY(InputData!A3:F,
"select D,count(B)
where D is not null
and year(D)="&C1&"
and E!='lost'
group by D
pivot C
label D 'TOTAL OPPORTUNITIES'"));
SPLIT(REPT(" ♠", COLUMNS(TRANSPOSE(QUERY(InputData!A3:F,
"select D,count(B)
where D is not null
and year(D)="&C1&"
and E!='lost'
group by D
pivot C
label D 'TOTAL OPPORTUNITIES'")))), "♠");
REGEXREPLACE(TO_TEXT(QUERY(QUERY({QUERY(
{InputData!D3:D&"♦"&InputData!C3:C, InputData!B3:F, InputData!D3:D&
IF(InputData!D3:D="",,"♥"&TEXT(InputData!D3:D, "m/d/yyyy"))},
"select Col1,Col4,Col3,Col7,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5 != 'lost'
group by Col1,Col4,Col3,Col7"),
IFNA(VLOOKUP(INDEX(QUERY({InputData!D3:D&"♦"&InputData!C3:C, InputData!B3:F},
"select Col1,Col4,Col3,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5 != 'lost'
group by Col1,Col4,Col3"),,1),
QUERY({InputData!D3:D&"♦"&InputData!C3:C, InputData!B3:F},
"select Col1,count(Col2)
where Col4 is not null
and year(Col4)="&C1&"
and Col5 != 'lost'
and Col6 = 'yes'
group by Col1"), 2, 0))},
"select Col4,Col3,Col6/Col5"),
"select Col2,max(Col3)
group by Col2
pivot Col1
label Col2'FTR%'
format max(Col3)'#.00%'")), "(\d+♥)", )})