Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help needed with a formula for dates in excel 2007 | Excel Worksheet Functions | |||
Formula for Between Dates (Excel 03) | Excel Discussion (Misc queries) | |||
formula for # of days between two dates-Excel 2000 | Excel Discussion (Misc queries) | |||
formula in excel to track times between two different dates ? | Excel Worksheet Functions | |||
Excel should have a formula for Converting Julian Dates | Excel Worksheet Functions |