Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Google Sheets – Assign category based on list of search words

I have a list of data, various text. I’d like to assign a category to each row, based on a list of search words.

I’ve made a mockup document, so you can see what’s going on, here.

The mockup example

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I have managed to do it, but in a complicated way. This is my current formula:
=ARRAYFORMULA(IF(REGEXMATCH(A4:A;F4);E4;IF(REGEXMATCH(A4:A;F5);E5;IF(REGEXMATCH(A4:A;F6);E6;"x"))))

So for each category I have to add another IF sentence.

I have 40+ categories in my original document, which means 40+ IF sentences in the same formula, not ideal.

Then I tried something like this:
=ARRAYFORMULA(IF(REGEXMATCH(A4:A;F4:F);E4:E;"x"))

.. which does not work at all.

What to do?

>Solution :

Try this out:

=ARRAYFORMULA(TOCOL(IF(REGEXMATCH(TOROW(A4:A);F4:F6);E4:E6;);1;1))

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading