+ Reply to Thread
Results 1 to 3 of 3

Return month even if first sunday is in previous month?

  1. #1
    Registered User
    Join Date
    03-16-2011
    Location
    San Francisco, CA USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Return month even if first sunday is in previous month?

    So I have my date in A1. as 2/27/2011. my formula in B1=TEXT(A1,"mmmm"). This returns the month for a formula that uses indirect to find a *.xls. Problem is that If my fiscal month is ...say March, the month starts on 2/27/2011 which will make B2="February" which will not pull any data, as my sales plans for 2/27/2011 are in the "March" workbook! Any help would be greatly appreciated!

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Return month even if first sunday is in previous month?

    Assuming Sunday to be the first day of any given week (as implied above) then you could perhaps try something along the lines of:

    Please Login or Register  to view this content.
    the above essentially establishes in which month the Sat of the same week occurs - so for 27th Feb the Sat of that week occurs on 5th March.

  3. #3
    Registered User
    Join Date
    03-16-2011
    Location
    San Francisco, CA USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Return month even if first sunday is in previous month?

    So Ive pretty much solved the problem. I didn't realize it but I had bigger problems. this was supposed to basic return what month and week a day was in. I got around this by creating a range with the first sunday of that week in A1. I then added down, A1+1,A1+2,A1+3,till I had my seven days of the week.

    date year month day week #
    2/27/2011 2011 March Sunday 1
    2/28/2011
    3/1/2011
    3/2/2011
    3/3/2011
    3/4/2011
    3/5/2011

    put the following formula in column C under Month:
    =TEXT(MEDIAN($A$2:$A$8),"mmmm")
    This says whatever month has more day in this week, that is what month this is.

    Then in column E under week# I put:
    =IF(VALUE(TEXT(A2,"m"))=VALUE(TEXT(MEDIAN($A$2:$A$8),"m")),ROUNDUP((DAY(A2)+WEEKDAY(DATE(YEAR(A2),MONTH(A2),0)))/7,0),1)
    This says if Sunday Month is not the month in C2 then it must be week 1

    I then just link all my files to the above data! YAY!

    Jordan

+ 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