Forum Discussion

AndrewLe's avatar
AndrewLe
Qrew Trainee
5 years ago

Using Less/Greater Than operators for numbers within a range?

Hello all,

I am currently trying to organize some numerical data with formula operations, however I am having an issue Quickbase taking my code:

if([Units Inspected]=0,0,1<=[Units Inspected]<=4,1,5<=[Units Inspected],[Units Inspected]/4.5)

I need to be able to control the output values when the input values fall within the range of 1 and 4 (inclusive). However, Quickbase is marking the second <= in 1<=[Units Inspected]<=4 as not being able to apply the operator, thus not making any of the code work at all. (All outputs are blank)

Is there a way around this or a different operator that I can use to control values that fall within a stated range of values?

Any help is appreciated,

------------------------------
Andrew Le
------------------------------

1 Reply

  • Quick Base will evaluate an IF in the sequence listed, stopping either when it runs out of tests or when it finds the first true one.  So it's all about the sequence.  It also helps your own sanity to write the formula vertically. 

    IF(
    [Units Inspected]=0,0,
    [Units Inspected]<=4,1,
    [Units Inspected]/4.5)


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------