1

I have looked for some functions like SEARCH(), MATCH(), FIND() but no one can really search a substring in a range and then it returns the row number, position or at least true/false.

Here is my case, I have a sheet like this:

-----------------------------
|     Group        | People |
-----------------------------
| Company - Tech   |   16   |
| Company - Sup    |   3    |
| Company - Assist |   8    |
| Family - Extend  |   12   |
| Family - Closed  |   3    |
-----------------------------

Now I need to do count people whose appropriate to similar groups: Company and Family.

|   Big Group      | Count |
----------------------------
| Company          |   ?   |
| Family           |   ?   |

How do I do it on this Google SpreadSheets

migrated from superuser.com Apr 13 '17 at 19:32

This question came from our site for computer enthusiasts and power users.

1

You can use the following:
=IF(A10<>"",SUMIF($A$2:$A$6,"*"&A10&"*",$B$2:$B$6),"")

A10 is the reference of "Company" in the Big Group
Write the formula instead of ? under Count
Sumif will test the whole column A ($A$2:$A$6 change it to correspond to all your Data in A and keep $) for Company (whatever is written with Company) and sum the corresponding Number in People Column $B$2:$B$6)
You can drag the formula
Keep the $ in the references for Absolute references
And change A and B to correspond to your Data (from first to last Row)

  • Yeah! awesome! the magic is "*"&A10&"*" – Davuz Apr 13 '17 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy