I'm working with a formula that returns 1 if the input matches a given value and returns 0 otherwise. I need it to work for 6,8,10,12. My current formula for 8 (Replace 8 with 6,10,12 and those work as well): floor((8-((X % 8) + ((X/8)-1)))/8) with 0 or 1 I then multiple that by X to get the value I need (either 0 or 8). Full Formula: floor((8-((X % 8) + ((X/8)-1)))/8)*8 Any suggestions to clean this up?