dimanche 30 décembre 2018

How to create a loop and move to the cell below when a condition is not met on excel or VBA?

I have a list of keywords and a list of questions on excel. I need to see IF every single keywords is found into the questions or not.

e.g.

       A                    B
   1 expense      how is my bonus calculated?
   2 business     how do i change my bank account? 
   3 bonus        how do i apply for a credit card?

I was trying to solve it with an IF statement on excel such as:

=IF(ISNUMBER(SEARCH(A1,B1)),A1,IF(ISNUMBER(SEARCH(A2,B1)),A2,IF(ISNUMBER(SEARCH(A3,B1)),A3,"no")))

but it works just for few keywords, so I was wondering if there is an alternative way as a formula or maybe an easy method on VBA to create a loop.

In other words: IF A1 is NOT on B1, look at A2, if not, look at A3, etc.

Thanks a lot to everyone will help!

Aucun commentaire:

Enregistrer un commentaire