If Statement Help

  • 1
  • 1
  • Question
  • Updated 3 months ago
  • Answered
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. 
Photo of Neal

Neal

  • 100 Points 100 badge 2x thumb

Posted 3 months ago

  • 1
  • 1
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)
Photo of Jason

Jason

  • 1,012 Points 1k badge 2x thumb
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