Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
pumper
 
Posts: n/a
Default Calculating for number of days when values are in dates

How do I write the formula if I want to calculate "length of stay", say hotel
check-in date was 1/1/2005 and check-out date was 1/10/2005? The answer is
easy, 10-1=9 days, but when it involves dates, how do you put it in a formula?
  #2   Report Post  
Max
 
Posts: n/a
Default

Assuming:

Check-in dates are in col A, A2 down
Check-out dates are in col B, B2 down

and

Length of stay is to be calculated in col C, C2 down

Put in C2: =B2-A2
Format C2 as "General" or "Number" (to zero dp)
Copy C2 down

Col C will return the results you want

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"pumper" wrote in message
...
How do I write the formula if I want to calculate "length of stay", say

hotel
check-in date was 1/1/2005 and check-out date was 1/10/2005? The answer

is
easy, 10-1=9 days, but when it involves dates, how do you put it in a

formula?


  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Sun, 16 Jan 2005 17:59:04 -0800, pumper
wrote:

How do I write the formula if I want to calculate "length of stay", say hotel
check-in date was 1/1/2005 and check-out date was 1/10/2005? The answer is
easy, 10-1=9 days, but when it involves dates, how do you put it in a formula?


If the check in date is in A1, and the check out date in A2, then =A2-A1 and
format the result as General.


--ron
  #4   Report Post  
pumper
 
Posts: n/a
Default

Max,
Thank you for the quick response. The mistake I did was I had C2 formated
as "date" instead of "General". Now it works!

Thanks,

pumper

"Max" wrote:

Assuming:

Check-in dates are in col A, A2 down
Check-out dates are in col B, B2 down

and

Length of stay is to be calculated in col C, C2 down

Put in C2: =B2-A2
Format C2 as "General" or "Number" (to zero dp)
Copy C2 down

Col C will return the results you want

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"pumper" wrote in message
...
How do I write the formula if I want to calculate "length of stay", say

hotel
check-in date was 1/1/2005 and check-out date was 1/10/2005? The answer

is
easy, 10-1=9 days, but when it involves dates, how do you put it in a

formula?



  #5   Report Post  
pumper
 
Posts: n/a
Default

Ron,

I didn't format my result as "General", that's why I kept getting weird
results. I got it now. Thank you.

pumper

"Ron Rosenfeld" wrote:

On Sun, 16 Jan 2005 17:59:04 -0800, pumper
wrote:

How do I write the formula if I want to calculate "length of stay", say hotel
check-in date was 1/1/2005 and check-out date was 1/10/2005? The answer is
easy, 10-1=9 days, but when it involves dates, how do you put it in a formula?


If the check in date is in A1, and the check out date in A2, then =A2-A1 and
format the result as General.


--ron



  #6   Report Post  
Max
 
Posts: n/a
Default

You're welcome !
Thanks for posting back
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"pumper" wrote in message
...
Max,
Thank you for the quick response. The mistake I did was I had C2 formated
as "date" instead of "General". Now it works!

Thanks,

pumper



  #7   Report Post  
pumper
 
Posts: n/a
Default

Max,

One more question...if I want Column C, i.e., C3 downward all the way (all
the way down, say I have a long spreadsheet) to have the same formula as in
cell reference C2, how do I do that?

pumper

"Max" wrote:

Assuming:

Check-in dates are in col A, A2 down
Check-out dates are in col B, B2 down

and

Length of stay is to be calculated in col C, C2 down

Put in C2: =B2-A2
Format C2 as "General" or "Number" (to zero dp)
Copy C2 down

Col C will return the results you want

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"pumper" wrote in message
...
How do I write the formula if I want to calculate "length of stay", say

hotel
check-in date was 1/1/2005 and check-out date was 1/10/2005? The answer

is
easy, 10-1=9 days, but when it involves dates, how do you put it in a

formula?



  #8   Report Post  
Max
 
Posts: n/a
Default

"pumper" wrote
One more question...if I want Column C, i.e., C3 downward all the way (all
the way down, say I have a long spreadsheet) to have the same formula as

in
cell reference C2, how do I do that


Just copy C2 down

Point the cursor at the bottom right corner of C2
(the cursor will change to a "black cross")

Now just left-click and drag down to copy C2 to C3, C4 ... C200 etc

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


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
How do I calculate difference in days & hours between two dates e. probi2 Excel Worksheet Functions 1 January 12th 05 03:59 PM
Subracting Dates to come up with the # of days between them KimberlyC Excel Worksheet Functions 8 December 20th 04 09:46 PM
Calculating Production/Man Days in Excel mpetersen Excel Discussion (Misc queries) 3 December 16th 04 02:41 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM
Calculating Average Values Using Arithmetic Equations ryangruhn Excel Worksheet Functions 0 November 3rd 04 07:42 PM


All times are GMT +1. The time now is 07:46 PM.

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"