我下面的公式不会有任何错误,但是,它没有为我提供正确的值。我正在尝试获取具有项目名称的产品总数:常规广告系列,并且状态为Disco / Supplier Status and On Hold。我在下面仅具有Disco / Supplier状态,因为我什至无法正确知道要添加多少保持状态。
=ArrayFormula(SUM(IF(REGEXMATCH(IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ/edit#gid=359656787","HIP Campaign!H:H"),"Regular Campaign*"),IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ/edit#gid=359656787","HIP Campaign!M:M"),"Disco/Supplier Status"),IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ/edit#gid=359656787","HIP Campaign!L:L"), 0))
尝试这样:
=ARRAYFORMULA(SUM(IF(
(REGEXMATCH(IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ", "HIP Campaign!H4:H"),
"Regular Campaig.*"))*
(REGEXMATCH(IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ", "HIP Campaign!M4:M"),
"Disco/Supplier|On Hold")),
IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ", "HIP Campaign!L4:L"), 0))
您可以尝试以下公式:
=QUERY({IMPORTRANGE("1eDIDiMfE5bIi-hEVtwJ7t2wD7A5zTRSt2mHhoQ_mUrQ","HIP Campaign!H4:M")},"select SUM(Col5) where where Col1 contains 'Regular Campaig' and Col6 matches 'Disco/Supplier|On Hold' label SUM(Col5)''")