How can you format batting averages?

Wade M

New Member
Joined
Apr 1, 2003
Messages
1
In baseball or softball, a batting average is calculated by dividing hits by at-bats. It is displayed as .333 or .400 or .025 or, if perfect, 1.000. However, a standard calculation yields a result such as 0.333 or 0.400, etc. Is there a way in Excel to format the calculation such that it drops the initial 0 in front of the decimal point? If so, is there a way to also allow the 1 if the batting average is 1.000? This one has been driving me nuts for a long time. Thanks for your help.

Wade in San Diego :-?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Wade M said:
In baseball or softball, a batting average is calculated by dividing hits by at-bats. It is displayed as .333 or .400 or .025 or, if perfect, 1.000. However, a standard calculation yields a result such as 0.333 or 0.400, etc. Is there a way in Excel to format the calculation such that it drops the initial 0 in front of the decimal point? If so, is there a way to also allow the 1 if the batting average is 1.000? This one has been driving me nuts for a long time. Thanks for your help.

Wade in San Diego :-?

Custom format to .000
 
Upvote 0
Welcome to the board. What you need here is conditional custom number formating. You want to display a number to the left of the decimal (an integer) but only if the number = 1 (1000 ave). Im presuming theres no supermen that can bat better than 1000 :-)

To do this, select Cells-Format and in the Custom format option enter this...

[=1]0.000;[<1].000;General

This means if the value is equal to 1 then put the format as 0.000 (ie 1.000 would be the result). If the value is <1 then its formated without the integer (ie 0.5000 would be .500).

regards
Parry
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top