using hours not time in Excel

scorpweb

Board Regular
Joined
Jul 26, 2011
Messages
124
Hey All,

i want to be able to add 0:12 as 12 minutes in Excel

if i format it to [h]:mm it LOOKS ok but in the formula bar it shows as 12:12 AM

problem with this then is that it won't pick up through excel due to this difference.


anyone know how to fix?

if it's easier i just need to check if the time is under 15minutes if it's quicker VBA could would be great
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
A2: 0:12

B2:

=IF(A2*24*60 < 15, 1, 0)

A hit is rendered as 1, a miss as a 0.

any idea how i can do this in VBA ...have lots of cells and it's going to linked to a condition to skip the row so either need to hard format the cell or VBA it.

thanks so much though :)
 
Upvote 0
A2: 0:12

B2:

=IF(A2*24*60 < 15, 1, 0)

A hit is rendered as 1, a miss as a 0.

managed to figure it out in VBA using this :) thanks

for anyone else it may help

Code:
dim time as integer
time = Sheets("data").Cells(e, LTColTot).Value * 24 * 60

if time < 15 then
.....

thanks again
 
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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