Hours between dates

L

Linda RQ

Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records which
give you an answer of 12.00 that would be 1 day. I think once I get this
formula fixed I hope I can get the other by selecting all the records and
divide by 24 to get my total days?

Thanks,
Linda
 
F

FSt1

hi
i think days360 counts days not hours. if your times are that close, you
might be better off just subtracting H2 from G2 and formating the results as
time ie [hh]:mm:ss. the brackets around the hh will cause the hours to
accumilate and not roll over every 24 hours.

Regards
FSt1
 
R

Rick Rothstein

If you need the actual decimal hours (13.666...), then try this formula...

=24*(H2-G2)
 
L

Linda RQ

Thanks Bob, I tried to put formatting in but I kept getting an error because
I really don't know where to put the parentheses so I tried Rick's solution
and it worked!


Bob Phillips said:
=B1-A1 and format as [h]:mm

--
__________________________________
HTH

Bob

Linda RQ said:
Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which give you an answer of 12.00 that would be 1 day. I think once I
get this formula fixed I hope I can get the other by selecting all the
records and divide by 24 to get my total days?

Thanks,
Linda
 
L

Linda RQ

Thanks FSt1, I couldn't figure out how to put the formatting into the
formula/fx


Linda

FSt1 said:
hi
i think days360 counts days not hours. if your times are that close, you
might be better off just subtracting H2 from G2 and formating the results
as
time ie [hh]:mm:ss. the brackets around the hh will cause the hours to
accumilate and not roll over every 24 hours.

Regards
FSt1

Linda RQ said:
Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which
give you an answer of 12.00 that would be 1 day. I think once I get this
formula fixed I hope I can get the other by selecting all the records and
divide by 24 to get my total days?

Thanks,
Linda
 
F

FSt1

hi
don't put the fomating in the formula.
right click the desired cell, choose format cell.
click the number tab. click custom. enter the custom format there.
once entered, you can format other cells by selecting the custom format
Regards
FSt1

Linda RQ said:
Thanks FSt1, I couldn't figure out how to put the formatting into the
formula/fx


Linda

FSt1 said:
hi
i think days360 counts days not hours. if your times are that close, you
might be better off just subtracting H2 from G2 and formating the results
as
time ie [hh]:mm:ss. the brackets around the hh will cause the hours to
accumilate and not roll over every 24 hours.

Regards
FSt1

Linda RQ said:
Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which
give you an answer of 12.00 that would be 1 day. I think once I get this
formula fixed I hope I can get the other by selecting all the records and
divide by 24 to get my total days?

Thanks,
Linda
 
B

Bob Phillips

It is square brackets, not parentheses.

--
__________________________________
HTH

Bob

Linda RQ said:
Thanks Bob, I tried to put formatting in but I kept getting an error
because I really don't know where to put the parentheses so I tried Rick's
solution and it worked!


Bob Phillips said:
=B1-A1 and format as [h]:mm

--
__________________________________
HTH

Bob

Linda RQ said:
Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which give you an answer of 12.00 that would be 1 day. I think once I
get this formula fixed I hope I can get the other by selecting all the
records and divide by 24 to get my total days?

Thanks,
Linda
 
L

Linda RQ

So it would be =B1-A1[h]:mm


Bob Phillips said:
It is square brackets, not parentheses.

--
__________________________________
HTH

Bob

Linda RQ said:
Thanks Bob, I tried to put formatting in but I kept getting an error
because I really don't know where to put the parentheses so I tried
Rick's solution and it worked!


Bob Phillips said:
=B1-A1 and format as [h]:mm

--
__________________________________
HTH

Bob

Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which give you an answer of 12.00 that would be 1 day. I think once I
get this formula fixed I hope I can get the other by selecting all the
records and divide by 24 to get my total days?

Thanks,
Linda
 
R

Rick Rothstein

You left out the "and format as" part...

=B1-A1 and format as [h]:mm

--
Rick (MVP - Excel)


Linda RQ said:
So it would be =B1-A1[h]:mm


Bob Phillips said:
It is square brackets, not parentheses.

--
__________________________________
HTH

Bob

Linda RQ said:
Thanks Bob, I tried to put formatting in but I kept getting an error
because I really don't know where to put the parentheses so I tried
Rick's solution and it worked!


=B1-A1 and format as [h]:mm

--
__________________________________
HTH

Bob

Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which give you an answer of 12.00 that would be 1 day. I think once I
get this formula fixed I hope I can get the other by selecting all the
records and divide by 24 to get my total days?

Thanks,
Linda
 
B

Bob Phillips

No it would be

=B1-A1

as the formula in the cell, then select menu Format>Cells>Custom and enter
[h]:mm in the inputbox.

--
__________________________________
HTH

Bob

Linda RQ said:
So it would be =B1-A1[h]:mm


Bob Phillips said:
It is square brackets, not parentheses.

--
__________________________________
HTH

Bob

Linda RQ said:
Thanks Bob, I tried to put formatting in but I kept getting an error
because I really don't know where to put the parentheses so I tried
Rick's solution and it worked!


=B1-A1 and format as [h]:mm

--
__________________________________
HTH

Bob

Hi Everyone,

I have been playing around and can't quite get it.

I have 2 columns Start Date and Time and End Date and Time

I tried this function =DAYS360(G2,H2)

4/5/07 4:12am
4/5/07 5:34 pm

Gives me 0.00 for an answer. I need the hours

The ultimate goal is to calculate total days which if I have 2 records
which give you an answer of 12.00 that would be 1 day. I think once I
get this formula fixed I hope I can get the other by selecting all the
records and divide by 24 to get my total days?

Thanks,
Linda
 

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