jeudi 24 décembre 2015

Alternative for If else statement in google spreadsheet or a macro script

In the google spreadsheet I can use this simple IF statement along with IMPORTRANGE to get data form another gsheet based on conditions.

=IF(G2="Reptiel",IMPORTRANGE("SpreadsheetID","Form Responses 1!AD2"),IF(G2="Kat",IMPORTRANGE("SpreadsheetID","Form Responses 1!I2"),IF(G2="Vogel",IMPORTRANGE("SpreadsheetID","Form Responses 1!J2"),"","","")

so that was for three If and it's already a mess and very long Obviously the formula will get complex and long as I need to do the same if-import nesting for 8 varibales.

So I was wondering if there is any alternate solution to this problem maybe a script or macro. Need help.

This could have been very easy to do in Excel - VBA but I have no experience in writing macros for gsheets.

Aucun commentaire:

Enregistrer un commentaire