+ Reply to Thread
Results 1 to 4 of 4

Placing the date (1-JAN-2008) in the right column for DAY

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Placing the date (1-JAN-2008) in the right column for DAY

    Dear Forum,

    Placing the date (1-JAN-2008) in the right column for DAY

    Now I have a Matrix in which I have the Days as Colum Headings and the Week Numbers as the Rows.

    I will be mentioning the Date let's say 1-JAN-2008 in the Cell A1 and I want this date to appear in the approriate Column for the DAY
    For Ex:-

    The day for the date 1-Jan-08 was a Tuesday, therefore the date should appear in the Column having a Heading Tuesday and in the Column Monday it should show as 31-Dec-07 and the Columns for Wednesday,Thursday,Friday,Saturday and Sunday the Following dates after 1-Jan-08 (i.e. 2-Jan-08, 3-Jan-08, 4-Jan-08, 5-Jan-08, 6-Jan-08).

    The appearance of the Date should change as per the day-date combination and as such for the preceding as well as following dates..

    Ex:- Lets say for 1-Jan-09 which comes on a Thursday it should display (1-Jan-09) under column Thu and Mon,Tue,Wed should display ( 29-Dec-08,30-Dec-08,31-Dec-08) and Friday,Saturday and Sunday the Following dates after 1-Jan-08 (i.e. 2-Jan-09, 3-Jan-09, 4-Jan-09).
    Last edited by e4excel; 11-08-2008 at 11:45 AM.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    See if this thread helps you out:

    http://www.excelforum.com/excel-work...-calendar.html

    Jason

  3. #3
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Assuming that A1 contains the date of interest, and B4:H4 contains the days of the week (Mon, Tue, Wed, etc.), maybe...

    B5, copied across:

    =$A$1+(COLUMNS($B5:B5)-MATCH(TEXT($A$1,"ddd"),$B$4:$H$4,0))

    Hope this helps!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    This is exactly what I wanted..!

    Hi Dominic,

    That was exactly what I wanted to achieve..
    Even I was trying myself but my code wasnot as compact as you and needed more modification...

    But anyways thanks for the help....

    < $B$1+(COLUMNS($D3:D3)-MATCH(TEXT($B$1,"ddd"),$D$2:$J$2,0)) >

+ 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