How to group excel items based on custom rules?

后端 未结 3 1907
感动是毒
感动是毒 2021-01-19 16:39

I have a set of data (webmaster tools search queries) which is in excel with the following header:

Query | Impressions | Clicks | Date

Sample go

3条回答
  •  半阙折子戏
    2021-01-19 17:13

    Ok, I changed your sheet a bit....

    Supposing all your data was in cells A1:C9, then you had the following table in cells F1:G5

    Search_For:    Category:
    laptop         Laptop
    iphone         Phone
    galaxy         Phone
    notebook       Laptop
    

    Now, in cell D2, put in the following formula:

    =IFERROR(INDEX(G$2:G$5,MATCH(TRUE,ISNUMBER(SEARCH(F$2:F$5,A2)),0)),"other")
    

    And enter it as an array formula Meaning, once you enter it, hit CTRL+SHIFT+ENTER.

    You can then drag the formula from cell D2 down and it should give you the desired results (and you can, of course, increase the list in columns F & G as necessary).

    Hope this does the trick!!

提交回复
热议问题