SOLVED

Conditional custom sorting in excel

Copper Contributor

Hey guys,

 

I have a simple excel table that I would like to sort based on a few columns. However instead of multi level custom sorting on different columns, I would like the program to execute a different sorting algorithm for cells that contain certain text in a column.

Examples below

sorting example.JPG

Say I'd like to sort by market first, and then by team, and then by product. But then when the market is for example "China" I would like those cells to be sorted by just product (ignoring team). Is there a way to achieve this?

 

Many thanks,

2 Replies
best response confirmed by michaelhou (Copper Contributor)
Solution

@michaelhou 

I'd add a helper column with formula

=IF(marketcell="China", productcell, teamcell)

and use that as second sort key instead of Team.

@Hans Vogelaar That's actually a great workaround. Thanks!

1 best response

Accepted Solutions
best response confirmed by michaelhou (Copper Contributor)
Solution

@michaelhou 

I'd add a helper column with formula

=IF(marketcell="China", productcell, teamcell)

and use that as second sort key instead of Team.

View solution in original post