Filter Excel rows by multiple parameters

Hello everyone,

I would like to filter Excel rows by two parameters using Dynamo. For example:
I need those rows, where two conditions (Anna & Active) will be fulfilled.

I don’t need these rows (Max & Active), because here is Max, not Anna

And I don’t need these rows (Anna & Approved), because here is Approved, not Active.

I can’t edit Excel file, it should be done with Dynamo, because it should be possible to change the conditions if needed.

For now, I have this Code:

But I don’t know how to filter the list with other two lists… List Create didn’t help, because this node just combine first two list in a huge one.

Maybe there is a Python code for that?

Thank you very much in advance!

FilterByBoolMask.dyn (46.8 KB) Test 1.xlsx (66.0 KB)

Try this:

  • Take the results from the first == nodes and wire them into a List.Create node. This will give you a list of two lists, totally something like 538 items and a L3 list structure.

  • Then use a List.Transpose node to convert to ordered pairs of results, in another L3 list. If both of the indexes in each L2 list are true then you want to keep the item in the original list.

  • Then use an AllTrue node at L2 to find out if each sublist has only true values. You should now have a L2 list of 269 true/false values.

  • Use this as the mask on your original list.

1 Like

Hello @JacobSmall

Thank you very much for your proposition! Only the last step didn’t work. But instead of ‘AllTrue’-Node I took ‘List.AnyFalse’-Node (from Clockwork Package). Now I’ve got exactly what I wanted - thank you! totally forgot about the ‘Transpose’-Node…

For your all true node - check the list level. Needs to be @L2.

1 Like

Thank you @JacobSmall
and sorry, your solution with ‘AllTrue’-Node and the List level @L2 worked as well.