Referencing a range in an equation

Hi all!

  I want to create an IIF equation for pattern instances that uses ranges

For example

Currently I have =( IIF ( "LENGTHd2@Sketch1" > 2000 , 3 , 2 )  )

Ideally I want to replace the '2000' with something that dictates:

<=2000 - 2 instances

Between 2001 and 5000 - 3 instances

Between 5001 and 7000 - 4 instances

Between 7001 and 9000 - 5 instances

and so on...

Is this possible?  Can post .prt if necessary.

Thanks

Oli

SolidworksGeneral