+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Batching According to Dates

    Hi

    I'm not very experienced with excel and am just looking for a basic formula to help me out

    Basically, we have a system that works on a batch system. The Batch will run from the 21st of the Previous month until the 20th of the Current month

    For example: All invoices and payments made from Jan 21st 2009 up to and including February 20th 2009 will be listed in the Period or "Batch" February 2009; or everything between June 21st 2009 up to and including July 20th 2009 will be in the "July 2009" Batch

    My question is, if i have a date in Cell B2 (eg 23/03/2009), I would like it to display in an adjacent cell (A2) "April 09" by recognising that it falls between the 21st day (inclusive) of the prior month and the 20th day (also inclusive) of the current month being diplayed in Cell B2.

    How is this achieved?

    All help is most appreciated

    Kind Regards

    George
    Last edited by georgeanaprop; 06-29-2009 at 10:37 AM.

  2. #2
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    XL2003 / 2007
    Posts
    2,447

    Re: Batching According to Dates

    Hi,

    Try this:

    =IF(DAY(B2)>=20,VALUE(MONTH(B2)+1&"/"&YEAR(B2)),VALUE(MONTH(B2)&"/"&YEAR(B2)))

    You'll need to format the column containing this formula:

    Custom > mmmm/yy
    Sarcasm - because beating the **** out of someone is illegal.

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Batching According to Dates

    Yes! That's exactly what I was looking for!

    Thank You
    Last edited by georgeanaprop; 06-29-2009 at 10:38 AM.

  4. #4
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Batching According to Dates

    Just came across a small hitch - when the date is after December 20th, it gives an error "#VALUE!" - most likely from the formula:

    =IF(DAY(B2)>=20,VALUE(MONTH(B2)+1&"/"&YEAR(B2)),VALUE(MONTH(B2)&"/"&YEAR(B2)))

    not being able to recognise that it has to go one year ahead ie. from 2008 - 2009 because the "YEAR" is still being traced from that in Cell B2

    Any ideas on how to adjust it so that it will hop one year forward when it reaches a "January Batch" ie Dec 21st 2008 - Jan 20th 2009?

    Thanks!

  5. #5
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    XL2003 / 2007
    Posts
    2,447

    Re: Batching According to Dates

    Sorry for the oversight

    =IF(AND(MONTH(B2)=12,DAY(B2)>=20),VALUE(MONTH(1)&"/"&YEAR(B2)+1),IF(DAY(B2)>=20,VALUE(MONTH(B2)+1&"/"&YEAR(B2)),VALUE(MONTH(B2)&"/"&YEAR(B2))))
    Sarcasm - because beating the **** out of someone is illegal.

  6. #6
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Batching According to Dates

    Thank You once again.

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.2.0