Forum Discussion

Del's avatar
Del
Qrew Cadet
5 years ago

Formula Help

I have an existing formula below that needs tweaking. I want the first conditions in bold to display "Ineligible" if the criteria is not met along with the other conditions. For example, If Are you a resident = No, then the field should display "Ineligible" regardless if any other criteria is met, same case with Age.



If(
[Are you a Resident?] = "Yes"
and
[Age] >= 18 and

[Total Number of Members in the Household] = 1 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?] > 1329.17 and
[Total monthly income for the household for past 30 days (Net income/Take home pay)?]<= 4529.17, "Eligible",
[Total Number of Members in the Household] = 1 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?]> 4529.17, "Ineligible")

------------------------------
Ermias Bean
------------------------------
  • try this

    If(
    [Are you a Resident?] = "No", "Ineligible",
    [Age] < 18, "Ineligible",

    [Total Number of Members in the Household] = 1 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?] > 1329.17 and
    [Total monthly income for the household for past 30 days (Net income/Take home pay)?]<= 4529.17, "Eligible",
    [Total Number of Members in the Household] = 1 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?]> 4529.17, "Ineligible")

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • PaulPeterson1's avatar
      PaulPeterson1
      Qrew Assistant Captain
      A little cleaner approach would be:

      If(
      [Are you a Resident?] = "No" or
      [Age] < 18, "Ineligible",

      [Total Number of Members in the Household] = 1 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?] > 1329.17 and
      [Total monthly income for the household for past 30 days (Net income/Take home pay)?]<= 4529.17, "Eligible",
      [Total Number of Members in the Household] = 1 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?]> 4529.17, "Ineligible")


      ------------------------------
      Paul Peterson
      ------------------------------
  • Here's a simplified formula:

    var bool residentEligible = [Are you a Resident?] = "Yes" AND [Age] >= 18;
    var bool singleMemberHousehold = [Total Number of Members in the Household] = 1;
    var bool payEligible = [Total monthly income for the household for past 30 days (Net income/Take home pay)?] > 1329.17 and [Total monthly income for the household for past 30 days (Net income/Take home pay)?]<= 4529.17;

    var text eligibile = ($residentEligible && singleMemberHousehold) && $payEligible;

    if ($eligibile, "Eligible", "Ineligible")

    ------------------------------
    Neil Schneider
    ------------------------------
    • NeilSchneider's avatar
      NeilSchneider
      Qrew Cadet
      There's an error in the formula, should be:
      var bool residentEligible = [Are you a Resident?] = "Yes" AND [Age] >= 18;
      var bool singleMemberHousehold = [Total Number of Members in the Household] = 1;
      var bool payEligible = [Total monthly income for the household for past 30 days (Net income/Take home pay)?] > 1329.17 and
      [Total monthly income for the household for past 30 days (Net income/Take home pay)?]<= 4529.17;

      var bool eligibile = ($residentEligible && singleMemberHousehold) && $payEligible;

      if ($eligibile, "Eligible", "Ineligible")

      ------------------------------
      Neil Schneider
      ------------------------------
      • NeilSchneider's avatar
        NeilSchneider
        Qrew Cadet
        Final edit - sorry used wrong syntax for 'AND"...
        var bool residentEligible = [Are you a Resident?] = "Yes" and [Age] >= 18;
        var bool singleMemberHousehold = [Total Number of Members in the Household] = 1;
        var bool payEligible = [Total monthly income for the household for past 30 days (Net income/Take home pay)?] > 1329.17 and
        [Total monthly income for the household for past 30 days (Net income/Take home pay)?]<= 4529.17;

        var bool eligibile = ($residentEligible and singleMemberHousehold) and $payEligible;

        if ($eligibile, "Eligible", "Ineligible")

        ------------------------------
        Neil Schneider
        ------------------------------