<div>
  <label>501 <input id="501a"></label>
  <label>501 <input id="501b"></label>
  <label>501 <input id="501c"></label>
  <label>Crk <input id="Crk1"></label>
  <label>Crk <input id="Crk2"></label>
  <label>Crk <input id="Crk3"></label>
  <button>Calculate</button>
  <label>Rating <input id="rating" readonly></label>
</div>
div {
  display: flex;
  flex-direction: column;
}

button {
  align-self: flex-start;
}
document.querySelector("button").addEventListener("click", calculate);

function calculate() {
  let Average501 = (IDv("501a") + IDv("501b") + IDv("501c")) / 3;
  let AverageCrk = (IDv("Crk1") + IDv("Crk2") + IDv("Crk3")) / 3;
        
  document.getElementById("rating").value = (Average501 + 10 * AverageCrk).toFixed(2);
}

function IDv(x) {
  return Number(document.getElementById(x).value);
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.