+ Reply to Thread
Results 1 to 20 of 20

how to calculate date base on previous row date value

  1. #1
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    how to calculate date base on previous row date value

    Respected All,

    this is my first post, if i didn't met with guidelines please forgive me

    i have a excel sheet

    in cell F4 i have a value December 31,2010
    in cell F11 i have a value 1
    in cell A27 i have formula as =$F$4

    in cell A28 the formula is =DATE(YEAR(INDIRECT("R[-1]C",0)),MONTH(INDIRECT("R[-1]C",0))+$F$11,DAY(INDIRECT("R[-1]C",0)))

    so here problem is a28 is dragged and used in a29, a30, a31........a 55 (same formula as in a28)

    in the mid espeically at feb 30 (since no feb 30 exist) it is missing feb then it is calculating mar 1st ...etc)

    could some body assist me how to get add a month




    present output
    ---------------
    12/31/2008 --> A27
    1/31/2009 --> A28
    3/3/2009 --> A29
    4/3/2009
    5/3/2009
    6/3/2009
    7/3/2009
    8/3/2009
    9/3/2009
    10/3/2009
    11/3/2009
    12/3/2009
    1/3/2010
    2/3/2010
    3/3/2010 --> A41.



    Expected Output is
    ---------------------
    12/31/2008 --> A27
    1/31/2009 --> A28
    2/28/2009 --> A29
    3/31/2009
    4/30/2009
    5/31/2009
    6/30/2009
    7/31/2009
    8/31/2009
    9/30/2009
    10/31/2009
    11/30/2009
    12/31/2009
    1/31/2010
    2/28/2010
    3/31/2010 --> A41.


    what changes do i need to my formula i am using =DATE(YEAR(INDIRECT("R[-1]C",0)),MONTH(INDIRECT("R[-1]C",0))+$F$11,DAY(INDIRECT("R[-1]C",0)))


    also i tried this one but some how it is calculating every month to be as 28....

    =DATE(YEAR(INDIRECT("R[-1]C",0)),MONTH(INDIRECT("R[-1]C",0))+$F$11,IF( (MONTH(INDIRECT("R[-1]C",0))+$F$11 ) = 2, IF(MOD(YEAR(INDIRECT("R[-1]C",0)),4)=0,29,28), DAY(INDIRECT("R[-1]C",0))) )


    Thanks in advance

    Bujji

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to calculate date base on previous row date value

    what are you trying to achieve with this?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    i attached a file just a work sheet report


    in the attachement i highlighted with yello color column
    Last edited by bujji; 12-13-2011 at 07:34 PM.

  4. #4
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    Could somebody please help me?

    Thanks a ton in advance

    please...


    bujj

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: how to calculate date base on previous row date value

    What good is a pdf for help with a workbook, you need to attach an example workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to calculate date base on previous row date value

    try the eomonth() function but im not going any further until you attach an excel version!

  7. #7
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    Hello Sir,

    please find work book i attached,

    please see A27, A28 you will get almost good idea what i am try to achieve

    Thanks a ton sir,

    please help me

    workbook.xls

  8. #8
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    here is workbook i attached

    please fins it
    Last edited by bujji; 12-13-2011 at 07:34 PM.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to calculate date base on previous row date value

    that works okay it is,you cant pay on 29th of feb so payment moves to march 1 then payments continue at 1 of month, unless you are expecting 2 payments in march of the first and 29th.

  10. #10
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    Hello Martin,

    Thanks for your response,

    it is not what it required

    instead of feb29 can we show feb28(non leap years) the date will be same in everymonth

    for ex if it is dec31 2009, then the expected dates will be Dec 31 2009, Jan31 2009, Feb 28 2009, Mar 31 2009, Apr 30 2009, May 31 2009

    so that means if day is not exist in this case(apr 31) then it shold calculate just previous day, please help me

    Thanks
    Best Regards
    Bujji

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: how to calculate date base on previous row date value

    Try this
    In A27
    Please Login or Register  to view this content.
    Drag/Fill Down
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  12. #12
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    Hi Marcol,

    Excellent, Awsome, i greatful to you Marcol,

    it is completelt working what i am expecting except small a small thing which is

    on a27 it is calculating next month to F4, it should be same as F4

    so what i mean to be is in F4 if we have Dec 31 2008
    then A27 will be same which is 12/31/2008 then A28 will be next 01/31/2009 then so on....

    right now it is calculating as A28 = F4 values + a monthcould you please change it

    Marcol, i greatful to you

    Hats offfff

    Thanks
    bujji

  13. #13
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    Please help me!!!!

    i am almost to end

    Thanks a lot
    bujji

  14. #14
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: how to calculate date base on previous row date value

    In A26
    Please Login or Register  to view this content.
    Then in A27
    Please Login or Register  to view this content.
    Drag/Fill Down
    Attached Files Attached Files
    Last edited by Marcol; 12-14-2011 at 06:27 AM. Reason: Desensitised attachment

  15. #15
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    Thanks Marcol

    Thanks alot

    thats work like Charm

    i greatful to you!

    Thats the solution, oh my goodness Thanks alot

    bye for now Marcol

  16. #16
    Registered User
    Join Date
    12-12-2011
    Location
    newyork
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: how to calculate date base on previous row date value

    hi marcol can you please remove the file from your last post

    please for scurity reasons

    thanks

  17. #17
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to calculate date base on previous row date value

    now that is daft! anyone reading that will probably download it and open it just to see why. I just did. do not post sensitive info, you could/should have deleted/replaced anything not relevant.

  18. #18
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: how to calculate date base on previous row date value

    I have "desensitised" the attachment.
    In addition to Martins' comment, you should also remember to remove/change the workbook author in the properties.
    If any sensitive information is to be used to your disadvantage, knowing who you are would be quite a handy start.

    You might also want to remove the external link you give in Post #7

  19. #19
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: how to calculate date base on previous row date value

    why not just =MIN(EOMONTH(a27,1),EOMONTH(A27,0)+DAY($F$4))
    Last edited by martindwilson; 12-14-2011 at 11:56 AM.

  20. #20
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: how to calculate date base on previous row date value

    @ martin .... indeed, why not? ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1