How to shorten the Expression of an Array?

Hello,

This post emerges from this original question / context :

Many Thanks for having solved the second part of the question, but I still do not see yet how to shorten the expression of arrays needed to process the match between Dial-Codes and Flags/Country-Names.

There is a working syntax for the calculation for an example of three items :

if(${Q2}= ‘C1’, ‘E1’, if(${Q2}= ‘C2’, ‘E2’, if(${Q2}= ‘C3’, ‘E3’, ’ ')))

but writing/repeating the <if(${Q2}= ‘C1’, ‘E1’,>sequence up to 244 times is a bit fastidious.

2023-08-16_Automatic_Answer_Select_Grid_Theme.53.3.1.xlsx (7.9 KB)

…so I was wondering if any syntax might be able to shorten the calculation-code, in order to streamline the expression of arrays, e. g. : if($[Q2]= ‘C1-C244’, ‘E1-E244’)

…Unfortunately, this piece of code doesn’t seem to work yet :

2023-08-16_Automatic_Answer_Select_Grid_Theme.53.4.0.xlsx (22.5 KB)

Is there any possibility to write some sort of short code instead of nesting each of 244 if-statements manually with so many brackets ? ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

#array

Any hints would be much appreciated,

:slight_smile:

@alienationfreez, it seems like you are using the if-statement. You should be able to learn more about the same here:

See your duplicated posting: How to keep Code short? - #8 by wroos.