mardi 29 janvier 2019

Turn NESTED IF Formula into Macro

I would like to turn my formula into a macro. I want to look up values on column A and return a different value to column D depending on conditions.

My formula is :

=IF(ISNUMBER(SEARCH("*10*",D2,6)),"word1",IF(ISNUMBER(SEARCH("*15*",D2,1)),"word2",IF(ISNUMBER(SEARCH("*1*",D2,1)),"word3",IF(ISNUMBER(SEARCH("*20*",D2,1)),"word4",IF(ISNUMBER(SEARCH("*30*",D2,1)),"word5")))))

I need to make sure that search for 1 comes after 10 or 15 so that formula doesn't return word3 for all cells containing "1".

Column A contains a text that is at times is misspelled so the only common value is the numbers. That is why I want to search the numbers within text to return word12345.

Aucun commentaire:

Enregistrer un commentaire