IF Condition - Join Multiple Columns

后端 未结 2 1910
醉话见心
醉话见心 2021-01-15 23:37

I need to tally the number of times a term appears. Unfortunately, the terms were not well organized so a term may appear in more than one column - so I can\'t use just

相关标签:
2条回答
  • 2021-01-16 00:27

    Seems a case for COUNTIF. Say your data is in A1:H1:

    =COUNTIF(A1:H1,"HEALTH")
    
    0 讨论(0)
  • 2021-01-16 00:33

    Depending on how you want to count your input cells, and assuming your input data is in A1:F1, you may want (1)

    =COUNTIF(A1:F1,"HEALTH")
    

    as posted by pnuts, or (2)

    =COUNTIF(A1:F1,"*HEALTH*")
    

    This version also counts cells which contain HEALTH with other characters as well.

    An alternative for formula (1) is

    =SUM(IF(A1:F1="HEALTH",1,0))
    

    entered as an array formula with Ctrl+Shift+Enter. Similarly for formula (2).

    There are other more complex cases you may want to consider: a) cells containing HEALTH more than once, b) HEALTH only as whole word, etc.

    0 讨论(0)
提交回复
热议问题