I have a sheet with a list of non-distinct master ID numbers that are grouped into "Group 1" through "Group 6" based on a distinct secondary ID. I am trying to write a formula to grab the greatest priority value if there are differences within the same master ID. My formula is in the correct priority order. Here is what I am using but getting an invalid operation error:
=IF(COLLECT({Group #}, {Master ID}, [MASTER_ID]@row ) = CONTAINS("Group 1", @cell ), "Group 1", IF(COLLECT({Group #}, {Master ID}, [MASTER_ID]@row ) = CONTAINS("Group 2", @cell ), "Group 2", IF(COLLECT({Group #}, {Master ID}, [MASTER_ID]@row ) = CONTAINS("Group 6", @cell ), "Group 6", IF(COLLECT({Group #}, {Master ID}, [MASTER_ID]@row ) = CONTAINS("Group 4", @cell ), "Group 4", IF(COLLECT({Group #}, {Master ID}, [MASTER_ID]@row ) = CONTAINS("Group 3", @cell ), "Group 3", IF(COLLECT({Group #}, {Master ID}, [MASTER_ID]@row ) = CONTAINS("Group 5", @cell ), "Group 5", ""))))))
Sheet is set up like this:
I want it to return Group 1 for 5897 and Group 2 for 5899. Is there a way to fix my formula to do this? Thanks!