Right now I have formatted my cell with:
h "hours" m "minutes"
So if my cell has 7:00
, it displays as 7 hours 0 minutes
. Is there a way to remove the hours or the minutes if these are zero? Something like 7 hours
, or 0:30
as 30 minutes
Hide zero values in selected cellsSelect the cells that contain the zero (0) values that you want to hide. You can press Ctrl+1, or on the Home tab, click Format > Format Cells. Click Number > Custom. In the Type box, type 0;-0;;@, and then click OK.
Hide error indicators in cells You can prevent these indicators from being displayed by using the following procedure. In Excel 2016, Excel 2013, and Excel 2010: Click File > Options >Formulas. > Excel Options > Formulas. Under Error Checking, clear the Enable background error checking check box.
If you have Excel 2007 or later versions (but apparently not Excel for Mac 2011) you can achieve this with a combination of regular formatting and conditional formatting.
Assuming data in A1 down use a regular custom format like this
[<0.0415][m]" minutes";h "hours" m "minutes"
That will give you the same as your previous formatting except that any value < 01:00 will display like
30 minutes
Now you can add a conditional formatting condition. With column A selected do this
Conditional Formatting > New Rule > Use a formula to determine which cells to format > type this formula in the box
=MINUTE(A1)=0
Click the "format" button and set the following number format
h" hours"
Now if you have 16:00 in A1 that will display as just 16 hours
[conditional formatting rules will always supercede regular formatting]
If you are dealing with "elapsed" times rather than clock times then you might want to use [h] rather than h in all the hours formats to show hours 24+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With