Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Need Date Formula Help

This formula is supposed to subtract one day every day. It works perfectly to
30 days, and then on the 31st day, it resets to zero. It needs to go
indefinitely, and I'm at a complete loss. Any suggestions?

=R19-DATE(YEAR(R19),MONTH(R19)-IF(DAY(R19)<DAY(L19),1,0),DAY(L19))&"days"

Excel 2003
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Need Date Formula Help

What is in R19, what in L19 and what exactly do you want tp happen?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"vegasrenie" wrote in message
...
This formula is supposed to subtract one day every day. It works perfectly
to
30 days, and then on the 31st day, it resets to zero. It needs to go
indefinitely, and I'm at a complete loss. Any suggestions?

=R19-DATE(YEAR(R19),MONTH(R19)-IF(DAY(R19)<DAY(L19),1,0),DAY(L19))&"days"

Excel 2003


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Need Date Formula Help

You'll need to tell us what dates you have in R19 and L19 and tell us why
you're qualifying the DAY in this:

IF(DAY(R19)<DAY(L19),1,0),DAY(L19)

--
Biff
Microsoft Excel MVP


"vegasrenie" wrote in message
...
This formula is supposed to subtract one day every day. It works perfectly
to
30 days, and then on the 31st day, it resets to zero. It needs to go
indefinitely, and I'm at a complete loss. Any suggestions?

=R19-DATE(YEAR(R19),MONTH(R19)-IF(DAY(R19)<DAY(L19),1,0),DAY(L19))&"days"

Excel 2003



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Need Date Formula Help

It isn't clear what you are trying to do, but don't forget that neither
DAY(R19) nor DAY(L19) will ever go beyond 31, because they are days in a
month.
Why not tell us what your L19 and R19 are, and what you are trying to
achieve with your formula?
As far as I can see the DATE function is giving you a date where the DAY
portion is the same day of the month as the date in L19, and the month is
the month before R19 if R19 is an earlier day of the month than L19, or
otherwise the same month as R19.
Hence as you increase L19 from the beginning of the month you are
progressively bringing the DATE function closer to R19 until when the day of
L19 equals the day of R19 you get R19 from your date function (and 0 days
from your complete formula), then when L19 goes one day beyond R19's day of
the month, the DATE function then goes back to the previous month, and
therefore the result of the formula is one less than the number of days in
the month before R19. The maximum will therefore be 30 if there were 31
days in that preceding month, or 29 if there were 30 days in that preceding
month, or 27 (or 28) if the preceding month was February (i.e. if R19 was in
March).

Does that explain it for you?
--
David Biddulph

"vegasrenie" wrote in message
...
This formula is supposed to subtract one day every day. It works perfectly
to
30 days, and then on the 31st day, it resets to zero. It needs to go
indefinitely, and I'm at a complete loss. Any suggestions?

=R19-DATE(YEAR(R19),MONTH(R19)-IF(DAY(R19)<DAY(L19),1,0),DAY(L19))&"days"

Excel 2003



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
formula to look at current date and markdown date to give price veena Excel Discussion (Misc queries) 4 November 13th 08 07:40 PM
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM


All times are GMT +1. The time now is 03:54 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"