+ Reply to Thread
Results 1 to 9 of 9

If dates are specific days, keep in specific cells

  1. #1
    Forum Contributor
    Join Date
    07-30-2014
    Location
    Mosman, Australia
    MS-Off Ver
    2013
    Posts
    118

    If dates are specific days, keep in specific cells

    Hi there,

    Not too sure how to explain this but I'll try.

    Basically, I want to enter the date of the first day of a month into one cell.

    Then the cells below it add the additional day (currently I have the formula "=weekday(a1, 1)" which is fine. However, everytime the month changes, the days change of course.

    Is there a formula I can write where the days always remain in the same row, just the date of each month changes (also removing the weekend).

    i.e
    .................A.................B..............C.........
    1 - Mon -.............. - ............. - 01/03/15
    2 - Tue - 01/01/15 - ............... - 02/03/15
    3 - Wed - 02/01/15 - .............. - 03/03/15
    4 - Thu - 03/01/15 - 01/02/15 -
    5 - Fri - 04/01/15 - 02/02/15 -
    6 - Mon - 07/01/15 - 05/02/15
    7 - Tue - 08/01/15
    8 - Wed - 09/01/15
    9 - Thu - 10/01/15

    Obviously the above dates are not correct, it's just for the example.

    If anyone could tell me the formula to use for this it would greatly appreciated!

    Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If dates are specific days, keep in specific cells

    Not really sure what you are trying to do here, and the copy/paste didnt come through to cleanly.

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    (maybe manually show a few different months so we can get a feel for what you want?)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If dates are specific days, keep in specific cells

    Hi,

    Does this help. With a date in A1 enter in A2 and copy down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor
    Join Date
    07-30-2014
    Location
    Mosman, Australia
    MS-Off Ver
    2013
    Posts
    118

    Re: If dates are specific days, keep in specific cells

    Thanks to both.

    So I've created a quick example of what I want and attached it.

    As you can, currently I only have the "workday" formula which helps remove weekends from the list. I like this but I want to keep specific days in specific cells.

    As shown on the right side of the spreadsheet, I'd like a list from Monday to Friday, and when the first date of the month is entered into the yellow highlighted field, I want a formula where if the first date falls on Thursday for example, then Monday to Wednesday in the list remain blank and the first Thursday in the list shows the first date then continues down the list until the last day of the month.

    Hopefully the spreadsheet makes sense. Sorry for making it sound so confusing.

    Thank you!
    Attached Files Attached Files

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: If dates are specific days, keep in specific cells

    Withdrawn by FR.
    Dave

  6. #6
    Forum Contributor
    Join Date
    05-04-2014
    Location
    New Jersey, United States
    MS-Off Ver
    Excel 2010, 2013
    Posts
    120

    Re: If dates are specific days, keep in specific cells

    Edited with some detail


    The attached file should hopefully provide you with a solution. Simply change the date in cell E2 to be the 1st of any month.

    The formula that I used in cell E5 is =MATCH(D5,TEXT({1,2,3,4,5,6,7},"dddd"),)+7*(COUNTIF($D$5:$D5,D5)-1)-WEEKDAY($E$2)+$E$2 which was double-clicked down to fill in the remainder of the sample data.

    Additional help is offered through a conditional formatting formula =IF(MONTH($E5)<>MONTH($E$2),TRUE,FALSE) in order to "hide" any days of the month which fall out of the lower bound and upper bound for that particular month.

    Sample Solution.xlsx
    Last edited by clabulis; 11-17-2015 at 12:06 AM.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If dates are specific days, keep in specific cells

    I used column G so I could compare with what you want.

    Put this in G7 and copy down...
    =IF(AND(COUNTIF($D$5:D5,D5)=1,D5=TEXT($E$2,"dddd")),$E$2,IF(SUM(G4,1)<$E$2,"",WORKDAY(G4,1)))

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If dates are specific days, keep in specific cells

    clabulis Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!

  9. #9
    Forum Contributor
    Join Date
    07-30-2014
    Location
    Mosman, Australia
    MS-Off Ver
    2013
    Posts
    118

    Re: If dates are specific days, keep in specific cells

    Hi all,

    Clabulis was able to provide exactly what I wanted, thank you all so much for your generous help, much appreciated!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to substract two dates columns and count for specific days
    By Zuluwaco in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-26-2015, 10:53 AM
  2. Replies: 6
    Last Post: 11-10-2014, 12:39 PM
  3. [SOLVED] Counting specific days between dates
    By floxxie in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-14-2014, 08:44 AM
  4. [SOLVED] need help calculating a specific portion of days from start/end dates.
    By nicki_rae22 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-13-2014, 09:51 AM
  5. Extract dates for specific days in a date range
    By Ricker090 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-13-2011, 09:36 PM
  6. How to calculate days between two dates (specific)
    By netone_1 in forum Excel General
    Replies: 7
    Last Post: 04-28-2011, 11:18 AM
  7. Determining the number of specific days between two dates in Excel
    By jon s in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-21-2005, 06:06 PM

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