List filtering by 2nd list | Outputs

Hi everyone,

I have three lists:
1st - the list where I can’t change the sorting;
2nd - the list of values that I need to compare with values in list No. 1;
3rd - if values matching in 2nd list, give this output.
4th - the list I’m after.

For example:
-for every value S04-M030 in list No.1 I need to give the value 6;

-for every value S04-M028 in list No.1 I need to give the value 4 and so on.

I was quite close with sorting everything out, but finally my list messed up by giving output 6 for D010,
4 for M028 and 1 for M030.

Anyone can help me to figure this out?

Thanks

Use list 2 & 3 to make a dictionary and “store” the relationship between the S codes and the numbers you want from the corresponding code.

Then use your list 1 to call the value stored in the dictionary.

1 Like

Great! Thank you!