Skip to content

Instantly share code, notes, and snippets.

@jjjjcccjjf
Last active March 16, 2020 09:40
Show Gist options
  • Save jjjjcccjjf/ce1a280c156588363f20ab7eec674529 to your computer and use it in GitHub Desktop.
Save jjjjcccjjf/ce1a280c156588363f20ab7eec674529 to your computer and use it in GitHub Desktop.

Formula

Variables

pedometer_counter_score_percentage = 15%
attendance_score_percentage = 20%
bmi_score_percentage = 50%
happiness_meter_score_percentage = 15%
mood_needed = 3 (maximum mood level)
steps_needed = 6000 (min steps per day)
floor_ideal_bmi = 18.5

total_score = bmi_score + pedometer_counter_score + attendance_score + happiness_meter_score

bmi_score = ABS(((ABS(weight_in_pounds - ROUND(floor_ideal_bmi * POWER((height_in_feet * 12) + height_in_inches, 2) / 703)) ? (max_target_weight / target_weight) : 2 * 100) - 100) * bmi_score_percentage) / 100

pedometer_counter_score = ((total_step_count_per_user / (max_items_in_quarter * steps_needed)) * 100) * pedometer_counter_score_percentage) / 100

attendance_score = (((total_attendance_per_user / (max_items_in_quarter) * 100) * attendance_score_percentage) / 100)

happiness_meter_score = (((total_mood_scores_per_user / max_items_in_quarter * mood_needed)) * 100) * happiness_meter_score_percentage) / 100)

Example:

Male
User 1
Score Pedometer counter - 9
Score Attendance - 20
Score BMI - 45
Score Happiness meter - 15
Total score this quarter - 89

User 2
Score Pedometer counter - 15
Score Attendance - 20
Score BMI - 50
Score Happiness meter - 12
Total score this quarter - 97

Scoreboard result:

  • User 2 will be top 1
  • User 1 will be top 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment