Skip to main content
Question

If Statement Help

  • July 30, 2018
  • 0 replies
  • 30 views

I'm trying to write a formula to return a numeric value. 
I have 5 numeric fields (Bedroom1, Bedroom2, Bedroom3, etc...) the user will enter in the square footage for each bedroom. 

I then have a field where I would like to calculate the number of bedrooms, but only If the value in each of the Bedroom fields is greater than 50 square feet. 
This topic has been closed for replies.

QuickBaseJunkie
Forum|alt.badge.img+15
You can use something like this:

If([Bedroom 1]>49,1,0)+
If([Bedroom 2]>49,1,0)+
If([Bedroom 3]>49,1,0)+
If([Bedroom 4]>49,1,0)

  • Quickbase Alumni
  • August 9, 2018
Or you could learn about variables and do something simple to start with like this. Not that it is really needed here but it helps learn a bit about variables in formulas.

var number bedone=If([Bedroom1]>49,1,0);
var number bedtwo=If([Bedroom2]>49,1,0);
var number bedthree=If([Bedroom3]>49,1,0);
var number bedfour=If([Bedroom4]>49,1,0);
var number bedfive=If([Bedroom5]>49,1,0);

$bedone+$bedtwo+$bedthree+$bedfour+$bedfive