Google 查找缺失月费的查询或公式

Google query or formula to find missing monthly fee

我正在尝试根据 google sheet..

中以下格式给出的数据构建以下仪表板

我可以计算 运行 余额,但它无法帮助我找出遗漏的费用月份。

任何帮助将不胜感激。

样本sheet:

https://docs.google.com/spreadsheets/d/1w5T36fk05Pw-0ARkxKUynrn5cUwfuWCEZ1lBt6UolZA/edit?usp=sharing

尝试:

=ARRAYFORMULA({REGEXREPLACE(TRIM({
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6=0, F3:H3&",", )),,9^9)), 
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6<>0, F3:H3&",", )),,9^9))}), ",$", ), I4:I6})


更新 1:

=ARRAYFORMULA({REGEXREPLACE(TRIM({
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6=0, F3:H3&",", )),,9^9)), 
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6<>0, F3:H3&",", )),,9^9))}), ",$", ), LEN(REGEXREPLACE({
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6<>0, ",", )),,9^9)), 
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6=0, ",", )),,9^9))}, "\s", ))*E4:E6, I4:I6})


更新 2:

=ARRAYFORMULA({REGEXREPLACE(TRIM({
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6=0, F3:H3&",", )),,9^9)), 
 FLATTEN(QUERY(TRANSPOSE(IF(F4:H6<>0, F3:H3&",", )),,9^9))}), ",$", ), 
 MMULT(F4:H6*1, SEQUENCE(COLUMNS(F3:H3))^0), I4:I6-
 MMULT(F4:H6*1, SEQUENCE(COLUMNS(F3:H3))^0), I4:I6})

更新 3:

=ARRAYFORMULA({REGEXREPLACE(TRIM({
 FLATTEN(QUERY(TRANSPOSE(IF((F4:H6=0)*(REGEXMATCH(F3:H3, "Feb|Apr|May")), F3:H3&",", )),,9^9)), 
 FLATTEN(QUERY(TRANSPOSE(IF((F4:H6<>0)*(REGEXMATCH(F3:H3, "Feb|Apr|May")), F3:H3&",", )),,9^9))}), ",$", ), 
 MMULT((F4:H6)*(REGEXMATCH(F3:H3, "Feb|Apr|May")), SEQUENCE(COLUMNS(F3:H3))^0), I4:I6-
 MMULT((F4:H6)*(REGEXMATCH(F3:H3, "Feb|Apr|May")), SEQUENCE(COLUMNS(F3:H3))^0), I4:I6})