hello, using this forumla at the moment however i need to add another INDIRECT("'3rd class'!A"&rowindex) into it and dont know how.

=IF(G30=1,INDIRECT("'1st class'!A"&rowindex),INDIRECT("'2nd class'!A"&rowindex))

at the moment if g30 has the value 1 it does the first bit and if it doesnt it does the 2nd bit. what i'm trying to do is have the value 1 in g30 do the first bit then when value 2 is entered is does the second bit then when the value 3 is inputted it does the 3rd bit that i;m trying to add in. thanks in advance