Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7876 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello

I have a range of numbers for streets. The fields are called lo and high.

If the field called "oddeven" says "o" i would like to get a random number in the range that is an odd number , but if the field "oddeven" says "e" I would like to get an even number in the range . Is this possible?

Thanks

Dave

Posted

I don't understand if you need to generate the number

if so than

2*Int(random*(lo-hi)/2 - 1)+(oddeven="o")

will do the job

Dj

Posted

Thanks for the answer. The only time it doesn't work is when the Hi and Lo number are the same in which case it just needs to be that number. For example, If Hi = 33 and lo = 33 then result should be 33. Not clear about that part, Also it puts a negative sign "-" before the number answer.

thanks

Dave

Posted

Sorry, didn't think before posting.

Here's the formula

Case(hi-lo ,Min(hi,lo)+2*Int(Random*(Abs(hi-lo)- 1)/2)+(oddeven="o"),hi)

and make Hi and Lo of type number (or use textToNum function)

Dj

This topic is 7876 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.