I´m trying to put one more criteria to this formula but there may not be any more criterias. That´s why I need a new way to do this. Following formula is used right now:

=IF($N15="","",CONCATENATE(IFERROR(INDEX(Städavgifter!$K$13:$K$500,SMALL(IF($N15=Städavgifter!$B$13:$B$500,ROW(Städavgifter!$B$13:$B$500)-ROW(Städavgifter!$B$13)+1),ROW($1:$1))),""),", ",IFERROR(INDEX(Städavgifter!$K$13:$K$500,SMALL(IF($N15=Städavgifter!$B$13:$B$500,ROW(Städavgifter!$B$13:$B$500)-ROW(Städavgifter!$B$13)+1),ROW($2:$2))),""),", ",IFERROR(INDEX(Städavgifter!$K$13:$K$500,SMALL(IF($N15=Städavgifter!$B$13:$B$500,ROW(Städavgifter!$B$13:$B$500)-ROW(Städavgifter!$B$13)+1),ROW($3:$3))),""),", ",IFERROR(INDEX(Städavgifter!$K$13:$K$500,SMALL(IF($N15=Städavgifter!$B$13:$B$500,ROW(Städavgifter!$B$13:$B$500)-ROW(Städavgifter!$B$13)+1),ROW($4:$4))),""),", ",IFERROR(INDEX(Städavgifter!$K$13:$K$500,SMALL(IF($N15=Städavgifter!$B$13:$B$500,ROW(Städavgifter!$B$13:$B$500)-ROW(Städavgifter!$B$13)+1),ROW($5:$5))),"")))

The formula is getting the value of fines for persons in the sheet named “Städböter”. The cell in N13 is a customer number he match with column B in the other sheet. In this rows where he finds matches he takes the fine (column K) and put it in this cell the formula is written in. But I only want him to take the fine if the status in column L is set as “Not Paid”. If it´s “Paid” he should ignore that one and go one to the next match. Every person can have a maximum number of 5 fines for each payment, as you can see.

What I would like to ad is IF($L$13:$L$500=”Paid”;””;

It would look like:

(IFERROR(INDEX(Städavgifter!$K$13:$K$500,SMALL(

**IF($L$13:$L$500=”Paid”;””;**IF($N15=Städavgifter!$B$13:$B$500,ROW(Städavgifter!$B$13:$B$500)-ROW(Städavgifter!$B$13)+1),ROW($1:$1))),"")

Problem is that it´s to many conditions. So, my (not really simple) question is, how could I do this in another way?

Thank you! I´m desperate!