2 Replies Latest reply on Jun 9, 2016 11:38 PM by user13722

# Case using a range of numbers

I want to write a calculation using CASE - I want to  select a field and if that field number is entered between 1-19 I want the calculation to return number 1, if that number entered  is between 20-25 i would like itr to return return number 2, if that number is between 21-30 return number 3, etc all the way to 1000 variations. I see that IF is not the way to go but I can not make Case work using a range of numbers. Any help would save me a LOT. Thanks

• ###### 1. Re: Case using a range of numbers

Case (

n < 1 ; 0 ; // value for under 1 that you don't say about it

n < 20 ; 1 ; // value for 1-19, I assume there are only integer numbers.

n < 26 ; 2 ; // value for 20-25

n < 31 ; 3 ; // value for 26-30

etc.

)

For "between" you need to write condition as

n >= 1 and n <=19

but in Case() function, usually need only one of edges.

BTW, when you have 1000 variations, it should be better to use value table and lookup or ExecuteSQL(), not the case for using Case().

• ###### 2. Re: Case using a range of numbers

I thnak you from the bottom of my heart. This worked GREAT !. I was trying

to do this for 4 days now and you saved me with one e-mail.

I wish I could buy you a beer.

Thanks again

Ron

Case using a range of numbers

in Discussions - View the full discussion

11>

Case (

n < 1 ; 0 ; // value for under 1 that you don't say about it

n < 20 ; 1 ; // value for 1-19, I assume there are only integer numbers.

n < 26 ; 2 ; // value for 20-25

n < 31 ; 3 ; // value for 26-30

etc.

)

For "between" you need to write condition as

n >= 1 and n <=19

but in Case() function, usually need only one of edges.

BTW, when you have 1000 variations, it should be better to use value table

and lookup or ExecuteSQL(), not the case for using Case().

Reply to this message by replying to this email, or go to the message on

FileMaker Community

11>

Start a new discussion in Discussions by email

<mailto:discussions-community-discussions@filemaker-inc-v8.hosted.jivesoftwa

re.com>  or at FileMaker Community