+ Reply to Thread
Results 1 to 17 of 17

Fill a range of cells based on a value in a cell

  1. #1
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Fill a range of cells based on a value in a cell

    Hello

    I am trying to produce a rudimentary timeline based on the number of days between a start and end date.

    I want the result to look like this; I want to fill 7 cells with an "X" automatically.
    sample output.jpg

  2. #2
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Quebec, Canada
    MS-Off Ver
    2013
    Posts
    232

    Re: Fill a range of cells based on a value in a cell

    In D4, drag right:
    =IF(COLUMN(D4)-COLUMN($D4)<$C4,"x","")

  3. #3
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    Wow. Thank you so much.

  4. #4
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    Hello again. @Jdevil wondering if you can help again.

    I want to be able to fill the cells in with an X starting from a particular cell. Output would look like this.
    I embedded your helpful formula into an IF statement to get the right date position - now I'm having trouble figuring out how to start the "x"s in the right cell.
    Here is my formula: =IF($A2<=D$1,IF(COLUMN(D2)-COLUMN($D2)<$C2,"x",""),"")
    The "x"s start in the right cell but don't fill for the value of what is the number of weeks.

    sample output.jpg

  5. #5
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Fill a range of cells based on a value in a cell

    Hi,
    use this
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    Thank you!!!

    worthy.gif

  7. #7
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    This is working great, except when the start/end date are in the same week. I would expect to see one "x" but the way the formula is coded, it is resolves to false overall.

    sample output.jpg
    Last edited by scottli; 08-23-2016 at 02:39 PM.

  8. #8
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Fill a range of cells based on a value in a cell

    Hi,
    If 5-Aug represents 5-12 August,then is not correct your mark.
    Next formula marks the weeks that contain at least one day of task interval.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    if you want different results, please define more precisely the criteria for marking
    Last edited by TudyBTH; 08-23-2016 at 03:08 PM.

  9. #9
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    Hi TudyBTH. No... 5-Aug represents 1-Aug to 5-Aug. It's the week ending date. 12-Aug represents 6-Aug to 12-Aug.

  10. #10
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Fill a range of cells based on a value in a cell

    then try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell


  12. #12
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Fill a range of cells based on a value in a cell

    Yes
    Capture1.JPG
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    You are RIGHT!! Of course!!!! I ended up deleting the #weeks column before I pasted in your formula . Sorry! And thank you, again.

  14. #14
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    Hello again. @TudyBTH, I'm hoping you can help again.
    If the task start and end dates are the same, the cell is blank. I need it to put a single x in the cell, which I had working - unless the start/end are the same as the "week ending" date.
    sample output.jpg

    (Also, I had to add logic to check if either start or end were blank, which could happen).

    I hope that makes sense.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Fill a range of cells based on a value in a cell

    Hi,
    try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,180

    Re: Fill a range of cells based on a value in a cell

    Try this ...

    =IF(AND(WEEKNUM($F4)<=WEEKNUM(S$2),WEEKNUM($G4)>=WEEKNUM(S$2)),"X","")

  17. #17
    Registered User
    Join Date
    08-19-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    15

    Re: Fill a range of cells based on a value in a cell

    THANK YOU! (Again)

    Last edited by scottli; 09-02-2016 at 10:28 AM.

+ 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] Fill in dates based on a date range in 2 cells
    By braun.reivn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2014, 05:54 PM
  2. [SOLVED] change fill color of a range of cells based on color of a cell?
    By DarMelNel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2014, 04:48 PM
  3. Fill down cells in column based on named range
    By Pademba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2013, 02:34 PM
  4. fill cell value based on range on another workbook
    By afronight_76 in forum Excel General
    Replies: 1
    Last Post: 07-09-2012, 05:00 PM
  5. Auto fill cells based on a date range given
    By timmy1254 in forum Excel General
    Replies: 2
    Last Post: 12-08-2011, 11:12 PM
  6. Auto fill a range based on another cell
    By Ricardo9211 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 04:58 PM
  7. [SOLVED] Is there a way to count cells in a range based on fill color?
    By eehinmd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-16-2006, 01:15 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