Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel Formula Dates

I have a cell that grabs the date of intake the next cell sees that cell and
puts in the last day of the month. for example if date of intake is 11/3/07
then the next cell shows 11/30/07. What I need is a formula to calculate the
number of days in the program.=DATEDIF(C16,D16,"D"). But if the date of
intake is 11/30/07 the next cell still puts in 11/30/07 and the formula
returns 0 as number of days when I need it to return 1. likewise in the next
set if the date is 12/1/07 and then 12/31/07 I need it to return 31 days.

  #2   Report Post  
Posted to microsoft.public.excel.programming
WHA WHA is offline
external usenet poster
 
Posts: 21
Default Excel Formula Dates

On Nov 29, 6:33 pm, krc547 wrote:
I have a cell that grabs the date of intake the next cell sees that cell and
puts in the last day of the month. for example if date of intake is 11/3/07
then the next cell shows 11/30/07. What I need is a formula to calculate the
number of days in the program.=DATEDIF(C16,D16,"D"). But if the date of
intake is 11/30/07 the next cell still puts in 11/30/07 and the formula
returns 0 as number of days when I need it to return 1. likewise in the next
set if the date is 12/1/07 and then 12/31/07 I need it to return 31 days.


Based on what I'm seeing here, I'd simply tack a "+ 1" onto the end of
the formula.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel Formula Dates



"WHA" wrote:

On Nov 29, 6:33 pm, krc547 wrote:
I have a cell that grabs the date of intake the next cell sees that cell and
puts in the last day of the month. for example if date of intake is 11/3/07
then the next cell shows 11/30/07. What I need is a formula to calculate the
number of days in the program.=DATEDIF(C16,D16,"D"). But if the date of
intake is 11/30/07 the next cell still puts in 11/30/07 and the formula
returns 0 as number of days when I need it to return 1. likewise in the next
set if the date is 12/1/07 and then 12/31/07 I need it to return 31 days.


Based on what I'm seeing here, I'd simply tack a "+ 1" onto the end of
the formula.
The only problem is that all the other cells then show a one in the days column wether there is a date or not. This can not happen because depending on number of days, it calculates cost.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Formula Dates

Then, test the date cell for a blank. If it is blank then return blank
("")instead of the "1".
based on your other formula:
=if(C16="","",DATEDIF(C16,D16,"D")+1)

"krc547" wrote in message
...


"WHA" wrote:

On Nov 29, 6:33 pm, krc547 wrote:
I have a cell that grabs the date of intake the next cell sees that
cell and
puts in the last day of the month. for example if date of intake is
11/3/07
then the next cell shows 11/30/07. What I need is a formula to
calculate the
number of days in the program.=DATEDIF(C16,D16,"D"). But if the date of
intake is 11/30/07 the next cell still puts in 11/30/07 and the formula
returns 0 as number of days when I need it to return 1. likewise in the
next
set if the date is 12/1/07 and then 12/31/07 I need it to return 31
days.


Based on what I'm seeing here, I'd simply tack a "+ 1" onto the end of
the formula.
The only problem is that all the other cells then show a one in the days
column wether there is a date or not. This can not happen because
depending on number of days, it calculates cost.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel Formula Dates



"DFruge" wrote:

Then, test the date cell for a blank. If it is blank then return blank
("")instead of the "1".
based on your other formula:
=if(C16="","",DATEDIF(C16,D16,"D")+1)

"krc547" wrote in message
...


"WHA" wrote:

On Nov 29, 6:33 pm, krc547 wrote:
I have a cell that grabs the date of intake the next cell sees that
cell and
puts in the last day of the month. for example if date of intake is
11/3/07
then the next cell shows 11/30/07. What I need is a formula to
calculate the
number of days in the program.=DATEDIF(C16,D16,"D"). But if the date of
intake is 11/30/07 the next cell still puts in 11/30/07 and the formula
returns 0 as number of days when I need it to return 1. likewise in the
next
set if the date is 12/1/07 and then 12/31/07 I need it to return 31
days.

Based on what I'm seeing here, I'd simply tack a "+ 1" onto the end of
the formula.
The only problem is that all the other cells then show a one in the days
column wether there is a date or not. This can not happen because
depending on number of days, it calculates cost.


what if I need to count number of days except if cell d17 is not the end of
the month. Example C17 and D17 are as follows:
c17=11/25/07 d17=11/29/07 instead of it returning 5 days I would need it
to return 4 days because the client was not here until the end of the month.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Excel Formula Dates

On Thu, 29 Nov 2007 16:33:02 -0800, krc547
wrote:

I have a cell that grabs the date of intake the next cell sees that cell and
puts in the last day of the month. for example if date of intake is 11/3/07
then the next cell shows 11/30/07. What I need is a formula to calculate the
number of days in the program.=DATEDIF(C16,D16,"D"). But if the date of
intake is 11/30/07 the next cell still puts in 11/30/07 and the formula
returns 0 as number of days when I need it to return 1. likewise in the next
set if the date is 12/1/07 and then 12/31/07 I need it to return 31 days.


Simply: =D16-C16+1

(No need to use DATEDIF for "days")
--ron
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
Help needed with a formula for dates in excel 2007 dloc Excel Worksheet Functions 2 March 17th 10 03:04 PM
Formula for Between Dates (Excel 03) Havenstar Excel Discussion (Misc queries) 4 January 15th 09 05:45 PM
formula for # of days between two dates-Excel 2000 kelley Excel Discussion (Misc queries) 1 June 29th 07 06:52 PM
formula in excel to track times between two different dates ? bmg Excel Worksheet Functions 3 February 21st 06 05:02 AM
Excel should have a formula for Converting Julian Dates Peo Sjoblom Excel Worksheet Functions 0 May 17th 05 06:15 PM


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

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

About Us

"It's about Microsoft Excel"