I’m sure @bravenel has some code that can do this, but I don’t think it’s an option in the standard routines.
There are a couple of third-party rules engines that can do it, so you might take a look at those if you’re in the U.S.: