SET A CONDITION

  • Thread starter Thread starter princy_varghese
  • Start date Start date
P

princy_varghese

I have the total number of hours and minutes between two dates and
times. but I also need to set a condition that checks whether the hours
have exceeded 24 hours.

For e.g. if 23/10/05 10:30 (Start time)
25/10/05 10:30 (End time)

Total no of hours is 47hours and 45 minutes.

I want to set a condition that will check if the hours exceed 24 hours
if so then comes with a message. I have tried IF function but it
doesnot check the minutes.

Please help
 
Hi,
From your example, with the start time in cell A1 and end time in cell
A2,
=A2-A1 would produce a result of 2 (or times 24 = 48 hours)
For the formula :
=IF((A2-A1)*24>24,"Exceeds 24 H",(A2-A1)*24)
should do the job ...

HTH
Cheers
Carim
 
time/date are stored as the number of days since january 1 1900.
Before the decimal point represents the number of days and therefore the
date, after the decimal point represents the time.
So simpy subtract your two date/times from each other. If >1 then that means
more than one day.

--
--
Adrian D.Bailey, Information and Systems Manager, Dept.Human Sciences
Loughborough University, Loughborough Leics, LE11 3TU, UK.
(e-mail address removed) Tel: 01509 223007 Fax: 01509 223940

Community Warden, Storer and Burleigh Areas. Out-of-hours Tel: 01509 563263
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top