 <p>If you have a huge amount of "if" or if you want to put this information in a settings file then I would suggest you create a class to store this information.</p> <pre><code>Class FromTime ToTime Value values.Add(New Class(0, 499, .75)); values.Add(New Class(500, 999, .85)); values.Add(New Class(1000, 9999, 1)); </code></pre> <p>Then you loop each items in the collection</p> <pre><code>if(object.Time &gt;= curItem.FromTime &amp;&amp; object.Time &lt;= curItem.ToTime) rate = curItem.Value; </code></pre> <p>You could always have nullable values or set -1 as infinite.</p> <pre><code>values.Add(New Class(-1, 0, 0)); values.Add(New Class(0, 499, .75)); values.Add(New Class(500, 999, .85)); values.Add(New Class(1000, -1, 1)); if((object.Time &gt;= curItem.FromTime || curItem.FromTime == -1) &amp;&amp; (object.Time &lt;= curItem.ToTime || curItem.ToTime == -1)) rate = curItem.Value; </code></pre>