Welcome to the forums!
This is not an insignificant type of problem to solve. It is typically called "binning by aggregate" or "slicing by aggregate". You might check out this blog post (Slicing by Aggregate | VizPainter) which explains several different approaches.
I'd be happy to discuss specifics of any or all.
Heh, I knew there was a good reason why I had trouble wrapping my brain around this problem. Perhaps this would be a great topic for the Tableau Jedi workshop at the upcoming customer conference.
I'll review the blog post this weekend and then respond back to this forum post. Thanks for the tip!