Portion Rate Base Calculator

.prb-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 600px; margin: 20px auto; padding: 25px; border: 1px solid #e1e4e8; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .prb-calc-container h2 { color: #1a1a1a; text-align: center; margin-bottom: 25px; font-size: 24px; } .prb-input-group { margin-bottom: 20px; } .prb-input-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #444; } .prb-input-group select, .prb-input-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 16px; } .prb-btn { width: 100%; background-color: #007bff; color: white; padding: 14px; border: none; border-radius: 6px; font-size: 18px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; } .prb-btn:hover { background-color: #0056b3; } .prb-result { margin-top: 25px; padding: 20px; background-color: #f8f9fa; border-radius: 8px; border-left: 5px solid #007bff; display: none; } .prb-result h3 { margin: 0 0 10px 0; color: #333; font-size: 18px; } .prb-result p { margin: 0; font-size: 22px; font-weight: bold; color: #007bff; } .prb-article { margin-top: 40px; line-height: 1.6; color: #333; } .prb-article h3 { color: #1a1a1a; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top: 30px; } .prb-formula-box { background: #f1f3f5; padding: 15px; border-radius: 6px; font-family: monospace; margin: 15px 0; text-align: center; font-size: 1.1em; }

Portion Rate Base Calculator

Portion (P) Rate (R%) Base (B)

Result

Understanding the Portion Rate Base Formula

In mathematics and business statistics, the relationship between three fundamental values—Portion, Rate, and Base—is essential for calculating percentages and proportions. This calculator simplifies these calculations using the standard percentage formula.

Portion = Rate × Base

Key Definitions

  • Base (B): The whole or the total amount. It represents 100% of the value being considered.
  • Rate (R): The percentage or the ratio. It represents what part of the base is being taken (usually expressed as a percentage).
  • Portion (P): The part or the result. It is the specific amount derived from multiplying the base by the rate.

How to Calculate Each Variable

Depending on which value is unknown, the formula can be rearranged:

  1. To find Portion: Multiply the Base by the Rate (in decimal form).
    Example: 20% of 500 is 100. (500 × 0.20 = 100)
  2. To find Rate: Divide the Portion by the Base, then multiply by 100 to get a percentage.
    Example: What percent of 200 is 50? (50 / 200 = 0.25 or 25%)
  3. To find Base: Divide the Portion by the Rate (in decimal form).
    Example: 40 is 10% of what number? (40 / 0.10 = 400)

Practical Example

Imagine a class of 40 students (Base). If 25% (Rate) of the students are athletes, how many athletes are there (Portion)?

Using the formula: 40 × 0.25 = 10. There are 10 athletes in the class.

function updateFields() { var mode = document.getElementById("calcMode").value; var label1 = document.getElementById("label1"); var label2 = document.getElementById("label2"); var val1 = document.getElementById("val1"); var val2 = document.getElementById("val2"); document.getElementById("prbResultBox").style.display = "none"; val1.value = ""; val2.value = ""; if (mode === "portion") { label1.innerHTML = "Rate (%)"; val1.placeholder = "e.g. 20"; label2.innerHTML = "Base (Total)"; val2.placeholder = "e.g. 500"; } else if (mode === "rate") { label1.innerHTML = "Portion (Part)"; val1.placeholder = "e.g. 100"; label2.innerHTML = "Base (Total)"; val2.placeholder = "e.g. 500"; } else if (mode === "base") { label1.innerHTML = "Portion (Part)"; val1.placeholder = "e.g. 100"; label2.innerHTML = "Rate (%)"; val2.placeholder = "e.g. 20"; } } function calculatePRB() { var mode = document.getElementById("calcMode").value; var v1 = parseFloat(document.getElementById("val1").value); var v2 = parseFloat(document.getElementById("val2").value); var resultValue = document.getElementById("resultValue"); var resultTitle = document.getElementById("resultTitle"); var resultBox = document.getElementById("prbResultBox"); var finalResult = 0; if (isNaN(v1) || isNaN(v2)) { alert("Please enter valid numbers in both fields."); return; } if (mode === "portion") { // P = (R/100) * B finalResult = (v1 / 100) * v2; resultTitle.innerHTML = "Calculated Portion (P):"; resultValue.innerHTML = finalResult.toLocaleString(undefined, {maximumFractionDigits: 4}); } else if (mode === "rate") { // R = (P / B) * 100 if (v2 === 0) { alert("Base cannot be zero."); return; } finalResult = (v1 / v2) * 100; resultTitle.innerHTML = "Calculated Rate (R):"; resultValue.innerHTML = finalResult.toLocaleString(undefined, {maximumFractionDigits: 4}) + "%"; } else if (mode === "base") { // B = P / (R/100) if (v2 === 0) { alert("Rate cannot be zero."); return; } finalResult = v1 / (v2 / 100); resultTitle.innerHTML = "Calculated Base (B):"; resultValue.innerHTML = finalResult.toLocaleString(undefined, {maximumFractionDigits: 4}); } resultBox.style.display = "block"; }

Leave a Comment