Forum Discussion

PennyPalmer's avatar
PennyPalmer
Qrew Member
14 hours ago

Formula to calculate hours

Please help write a formula to take estimated hours time different frequencies (daily, weekly, monthly) and calculate monthly hours.

I currently have box for estimated hours, and radio buttons for different frequencies (daily, weekly, monthly, quarterly, yearly).  

7 Replies

  • Not all months have the same number of days or weeks.  For the purposes of this calculation, how many days are there in a month?  How many weeks are there in a month.

    • PennyPalmer's avatar
      PennyPalmer
      Qrew Member

      for weeks, we use 4.33.  For days, we usually use workdays 20 per month.  Its not perfect, but we know there is going to be some variation.  Thank you!

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        There is more than one way to write this formula, but probably the most concise way of doing it is using the Case function. That is because we are going to repeatedly be checking the same field to see what the value is.  

        Case([Frequency],

        "Daily", [Estimated Hours] * 20,

         "Weekly", [Estimated Hours] * 4.33,

        "Monthly", [Estimated Hours],

        "Quarterly", [Estimated Hours] / 3

        "Annually", [Estimated Hours] / 12)

         

  • HI!  Thank you for responding! Here's some examples.  Please let me know if there is something else I can provide.  

    Need QB formula to calculate Monthly hours based on inputs.  

    Estimated Hours (numeric field):  5

    Frequency (field uses radio button)    Weekly 

    OR

    Estimated hours:  2

    Frequency radio button:   Daily 

    THANKS

     

     

  • Can you give us numerical examples for each of the daily, weekly, monthly, quarterly, yearly choices, assuming that the estimated time is 1

  • Can you provide a sample of the expected output? So for instance is estimate hours a numeric field that users type numbers into. And let's say they put in "8", what do you want to see for daily, weekly, monthly?

    • PennyPalmer's avatar
      PennyPalmer
      Qrew Member

      HI!  Thank you for responding! Here's some examples.  Please let me know if there is something else I can provide.  

      Need QB formula to calculate Monthly hours based on inputs.  

      Estimated Hours (numeric field):  5

      Frequency (field uses radio button)    Weekly 

      OR

      Estimated hours:  2

      Frequency radio button:   Daily 

      THANKS