Number of hours between now and selected date

I

Igor

I need a formula to calculate number of hours between data and time set in
the cell by function NOW() and a set date in the same format:

Example:

NOW() - return 29/07/2009 16:06:00
set date - 07/08/2009 06:00:00
result to be difference between the dates presented in hours
 
M

Mike H

Hi,

with the eralier date/time in A1 and the later in b1 try

=B1-A1

Format the cell as [hh]:mm

Mike
 
I

Igor

Thank you I tried, it returns only hours and minutes, however, days are
missed in the return

Mike H said:
Hi,

with the eralier date/time in A1 and the later in b1 try

=B1-A1

Format the cell as [hh]:mm

Mike

Igor said:
I need a formula to calculate number of hours between data and time set in
the cell by function NOW() and a set date in the same format:

Example:

NOW() - return 29/07/2009 16:06:00
set date - 07/08/2009 06:00:00
result to be difference between the dates presented in hours
 
M

Mike H

Hi,

If the days will never exceed 31 then you can get away with changing the
format to

dd:hh:mm

if it will/may exced 31 then use

=INT(B1-A1) & " " &TEXT(B1-A1,"hh:mm:ss")

Mike

Igor said:
Thank you I tried, it returns only hours and minutes, however, days are
missed in the return

Mike H said:
Hi,

with the eralier date/time in A1 and the later in b1 try

=B1-A1

Format the cell as [hh]:mm

Mike

Igor said:
I need a formula to calculate number of hours between data and time set in
the cell by function NOW() and a set date in the same format:

Example:

NOW() - return 29/07/2009 16:06:00
set date - 07/08/2009 06:00:00
result to be difference between the dates presented in hours
 
D

David Biddulph

If you want to show a number of hours beyond 24, [hh]:mm will show them.
Formatting as hh:mm (without the square brackets) would not.

If you want to return the number of hours as a decimal, then use
=(B1-A1)*24, and format as general or number, not as time.
--
David Biddulph

Igor said:
Thank you I tried, it returns only hours and minutes, however, days are
missed in the return

Mike H said:
Hi,

with the eralier date/time in A1 and the later in b1 try

=B1-A1

Format the cell as [hh]:mm

Mike

Igor said:
I need a formula to calculate number of hours between data and time set
in
the cell by function NOW() and a set date in the same format:

Example:

NOW() - return 29/07/2009 16:06:00
set date - 07/08/2009 06:00:00
result to be difference between the dates presented in hours
 
F

Fred Smith

That's because you asked for the number of hours (see your subject). If you
wanted to know the number of days, you need to specify that. Responders here
will answer the question that's asked.

Regards,
Fred

Igor said:
Thank you I tried, it returns only hours and minutes, however, days are
missed in the return

Mike H said:
Hi,

with the eralier date/time in A1 and the later in b1 try

=B1-A1

Format the cell as [hh]:mm

Mike

Igor said:
I need a formula to calculate number of hours between data and time set
in
the cell by function NOW() and a set date in the same format:

Example:

NOW() - return 29/07/2009 16:06:00
set date - 07/08/2009 06:00:00
result to be difference between the dates presented in hours
 

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

Top