ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Question on Format in Hour & Minute (https://www.excelbanter.com/excel-worksheet-functions/90035-question-format-hour-minute.html)

ims

Question on Format in Hour & Minute
 
Dear all,

2 questions please.

I have got a spreadsheet to calculate time in hours and minutes

A B C
15:00 20:15 5:15

1. When I input "15" in Cell A1, how to format to make it display "15:00"
?

2. Cell C1=B1-A1, similarly, how should B1 & C1 be formatted?

Thanks
IMS




Arvi Laanemets

Question on Format in Hour & Minute
 
Hi


"ims" wrote in message
...
Dear all,

2 questions please.

I have got a spreadsheet to calculate time in hours and minutes

A B C
15:00 20:15 5:15

1. When I input "15" in Cell A1, how to format to make it display
"15:00"


You can't!. Either enter 15:0, or use another column with formulas to
convert it to time [=TIME(A1,0,0)], or use worksheet's Change event to
rewrite any entry made into column A.


?

2. Cell C1=B1-A1, similarly, how should B1 & C1 be formatted?


For cell B1, look above. Format the cell C1 in any valid time format.

P.S. In case you have time intervals with midnight rollover, use formula
C1=B1-A1+(B1<A1)



--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



[email protected]

Question on Format in Hour & Minute
 
Not strictly accurate, as you CAN do it IF you are happy to use macros
and IF the values for time always go in column A and IF the values are
always entered incorrectly - but personally, I would look to get people
to enter the values in the right format, or to have functions later on
that translated what had been entered into the value you wanted (so the
input cell asks for minute and will accept whole numbers only, then the
formula converts the decimal number into the correct fraction for time)


ims

Question on Format in Hour & Minute
 
Understood.....thank you all



egroups.com...
Not strictly accurate, as you CAN do it IF you are happy to use macros
and IF the values for time always go in column A and IF the values are
always entered incorrectly - but personally, I would look to get people
to enter the values in the right format, or to have functions later on
that translated what had been entered into the value you wanted (so the
input cell asks for minute and will accept whole numbers only, then the
formula converts the decimal number into the correct fraction for time)






All times are GMT +1. The time now is 04:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com