Displaying minutes


Posted by Richie Turner on April 12, 2001 8:16 AM

Anyone know how I can format a cell so it shows the number of minutes.

eg. cell A1 contains NOW() and if I format A1 to "h" it will give me the current hour, if I format it to "d" it will give me the current day of the month and the same for "s" for seconds and "y" for year.
However if I format it to "m" it will give me the current month of the year and NOT the current minute of the hour.

can anyone help?

cheers

Richie

Posted by Mark W. on April 12, 2001 9:15 AM

Richie, as stated in the Help topic for "Formats
for dates and times":

'To display days, months, and years, include the
following format codes in a section. If you use
"m" immediately after the "h" or "hh" format code
or immediately before the "ss" code, Microsoft
Excel displays minutes instead of the month.'

The best advice I can offer is to use the formula,
=NOW()-TEXT(NOW(),"ss")/86400, and format the cell
as m:ss .

Posted by Stephane Parent on April 12, 2001 9:45 AM


Hi Richie,

I think you could use this:
=MINUTE(NOW())
and keep the format as general

Stephane Parent

Posted by Mark W. on April 12, 2001 10:16 AM

A more elegant formula that still preserves datetime value...

Richie, over lunch I realized that, a more elegant
formula would be: =FLOOR(NOW(),1/1440) , as stated in the Help topic for "Formats



Posted by Dave Hawley on April 12, 2001 4:45 PM

Stephanes' formula will do the trick!

OzGrid Business Applications