Excel SUMIFS checking if a column contains text

柔情痞子 提交于 2019-11-28 09:42:04

问题


I have an excel document with data in a PivotTable that is displayed with several subcategories. I need to check if text anywhere in column A contains a particular word and then also check the text in column C to see if it contains a particular exact phrase.

So far, I'd come up with

=SUMIFS('tab1'!D5:D300, 'tab1'!A5:A300, "WORD", 'tab1'!C5:C300, "PHRASE")

The issue I've run into is that the excel tab this formula is checking displays information like this and it will give me the result of "0" for anything but the first phrase (which I assume is because the first phrase shares a row with the category "WORD"):

Excel Information Example:

The data in the PivotTable can change drastically throughout the year, and it is how it displays the information so I have no control over how that information is presented.

Is there a way to check if column A at any point contains a particular word, but doesn't necessarily need to match up in the appropriate row.


回答1:


=IF(INDEX(C5:C300,MATCH("WORD 2",A5:A300,0),0)<>"PHRASE","",INDEX(D5:D300,MATCH("WORD 2",A5:A300,0)))

Hope it'll help.. (:



来源:https://stackoverflow.com/questions/51449555/excel-sumifs-checking-if-a-column-contains-text

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!