Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default furmula to add hours

I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default furmula to add hours

Hi

Try
=B3+TIME(23,59,59)

Since time is stored as fractions of a day, you could also use
=B3+3.5/24 to add 3 hours 30 minutes to the value in B3

--

Regards
Roger Govier

"Stephen" wrote in message
...
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default furmula to add hours

Dates are stored by Excel as a number with the format dddd.ttttt where dddd
is the number of days since 0-Jan-1900 and tttt is a fraction of a 24-hour
day (e.g., 6:00 = 0.25, 12:00 = 0.5, 18:00 = 0.75, etc). Thus, you need to
strip the date component off of the second datetime before adding it to the
first.

=A1+B1-INT(B1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)


"Stephen" wrote in message
...
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default furmula to add hours

Good stuff. thanks!

"Roger Govier" wrote:

Hi

Try
=B3+TIME(23,59,59)

Since time is stored as fractions of a day, you could also use
=B3+3.5/24 to add 3 hours 30 minutes to the value in B3

--

Regards
Roger Govier

"Stephen" wrote in message
...
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formating Furmula jockj215 Excel Discussion (Misc queries) 3 December 4th 09 12:36 PM
I want to get a furmula for get a percentage Bassil Excel Worksheet Functions 1 June 29th 08 06:08 PM
Need furmula of R-squared by polynomial regression Xiaoyoy Yun Excel Programming 2 November 21st 07 08:45 PM
Desperately needing furmula help Fred Djinn Holstings Excel Discussion (Misc queries) 11 February 2nd 07 07:46 PM
Issue creating a furmula in VBA, Please Help mikeb Excel Programming 3 November 6th 06 06:33 PM


All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"