谷歌查询或公式查找缺少的月费
Posted
技术标签:
【中文标题】谷歌查询或公式查找缺少的月费【英文标题】:Google query or formula to find missing monthly fee 【发布时间】:2021-12-14 01:06:18 【问题描述】:我正在尝试根据谷歌表格中以下格式给出的数据构建以下仪表板..
我可以计算流动余额,但这并不能帮助我计算出缺少的费用月份。
我们将不胜感激。
样本表:
https://docs.google.com/spreadsheets/d/1w5T36fk05Pw-0ARkxKUynrn5cUwfuWCEZ1lBt6UolZA/edit?usp=sharing
【问题讨论】:
【参考方案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))), ",$", ), 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)
【讨论】:
@SameerFarooqui 编辑您的工作表并包含所需结果的示例 @SameerFarooqui 回答已更新 @SameerFarooqui 回答已更新 @SameerFarooqui 已修复,立即尝试 @SameerFarooqui 答案更新为所选月份的示例以上是关于谷歌查询或公式查找缺少的月费的主要内容,如果未能解决你的问题,请参考以下文章
excel公式中:查找值,数据表,列序表,匹配条件各是啥意思?
谷歌表格中带有 ifs、isblank 和 AND/OR 的数组公式