Calculate batting average in Numbers

I am trying to calculate batting average for my kids baseball team in numbers. I've tried various formulas but I cannot get numbers to drop the number before the decimal (i.e. a batting average that would read like .333)


Does anyone have a formula that works?

Posted on Mar 20, 2024 8:23 AM

Reply
Question marked as Best reply

Posted on Mar 21, 2024 7:03 AM

This works but I found what appears to be a bug when I was setting up the custom format. I got this before I set the decimals to show trailing zeros:



If the number did not have 3 or more decimal digits (i.e., the number of digits specified in the format), it put a 0 on the front of the number. It worked correctly after setting it to show trailing zeros.



12 replies
Question marked as Best reply

Mar 21, 2024 7:03 AM in response to bob264

This works but I found what appears to be a bug when I was setting up the custom format. I got this before I set the decimals to show trailing zeros:



If the number did not have 3 or more decimal digits (i.e., the number of digits specified in the format), it put a 0 on the front of the number. It worked correctly after setting it to show trailing zeros.



Apr 26, 2024 8:58 PM in response to WCCIII

Create a new column next to the calculated batting average. Let’s say the batting average is in cell A2.


Use the following function:


RIGHT(A2,4)


This will return the first four characters from the right side of the batting average, and will trim off the zero.


Note that anyone batting “a thousand” (ie. 1.000) will show up as batting “zero” with this function (ie. .000).


If that bothers you, you could try nesting the RIGHT function inside an IF function like this:


IF(A2=1,A2,RIGHT(A2,4))

Mar 22, 2024 7:42 AM in response to WCCIII


To calculate batting average in Numbers and display it with only three decimal places, you can use a formula along with cell formatting. Here's how you can do it:

  1. Enter Data: Enter the number of hits and at-bats for each player in separate columns. Let's assume hits are in column A and at-bats are in column B.
  2. Calculate Batting Average: In a new column, enter the formula to calculate batting average. The formula for batting average is: Hits / At-bats.
  3. Assuming your hits are in column A and at-bats are in column B, you can use the formula =A1/B1 in the first row of the new column.
  4. Format the Cell: Select the cell containing the batting average formula. Then, go to the Format menu and choose "Cell" > "Data Format" > "Number." Set the Decimal Places to 3.
  5. This will ensure that the batting average is displayed with only three decimal places.


Here's a step-by-step guide:

  1. Enter your data in separate columns. Let's say hits are in column A and at-bats are in column B.
  2. In a new column (let's say column C), enter the formula =A1/B1 for the first player.
  3. Drag the fill handle (the small square at the bottom-right corner of the cell) down to apply the formula to other players.

By following these steps and formatting the cell to display three decimal places, you should be able to calculate and display the batting average correctly in Numbers.

Calculate batting average in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.