ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SET A CONDITION (https://www.excelbanter.com/excel-programming/375470-set-condition.html)

[email protected]

SET A CONDITION
 
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


Carim

SET A CONDITION
 
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)*2424,"Exceeds 24 H",(A2-A1)*24)
should do the job ...

HTH
Cheers
Carim


Adrian D. Bailey

SET A CONDITION
 
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.
Tel: 01509 223007 Fax: 01509 223940

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

wrote in message
oups.com...
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





All times are GMT +1. The time now is 08:51 AM.

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