+ Reply to Thread
Results 1 to 5 of 5

Formula to pick value from 1 cell and fill in other cells upto the value in first cell

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    Perth
    MS-Off Ver
    Microsoft Office 365 - Excel 2019
    Posts
    15

    Formula to pick value from 1 cell and fill in other cells upto the value in first cell

    Hi Guys


    Am trying to find a formulae whereby in the attached spread sheet I have say client 1 in Column B who enrols on a program for 12 months (hard code number in cell c4) and starts in Month 1 (Hard Code in Cell d4) then in cell e 4 the number 1 appears upto the next 12 months. Similarly if the client 2 starts a program for 6 months but starts in month 2 than in cell F5 the number 1 appears and continues for 6 months. The formula should be flexible such that if I change the number in say cell c5 from 6 to 5 and change the month from say Month 2 to Month 3 than the resulting numbers in column e to R change accordingly


    Please see attached spreadsheet as an example of what I am looking for.


    Thanks for your help in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula to pick value from 1 cell and fill in other cells upto the value in first cell

    In E4 then drag down and accross:

    Please Login or Register  to view this content.
    Quang PT

  3. #3
    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,938

    Re: Formula to pick value from 1 cell and fill in other cells upto the value in first cell

    Based on your sample...
    =IF(AND(COUNTA($E$3:E$3)>=MATCH($D4,$E$3:$R$3,0),COUNTA($E$3:E$3)<=MATCH($D4,$E$3:$R$3,0)+$C4),1,"")
    copied down and across

    edit: Nice 1 Quang

    This would also probably be easier if real dates were used
    Last edited by FDibbins; 05-04-2015 at 12:32 AM.
    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

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula to pick value from 1 cell and fill in other cells upto the value in first cell

    Quote Originally Posted by FDibbins View Post
    edit: Nice 1 Quang
    This would also probably be easier if real dates were used
    Thanks, Ford.
    I agree that if real dates were used it would be applied the math on them.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Formula to pick value from 1 cell and fill in other cells upto the value in first cell

    E4=IFERROR(IF(COLUMN()-MATCH($D4,$A$3:E$3,0)+1<=$C4,1,""),"")
    Try this and copy across
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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. Replies: 5
    Last Post: 01-23-2014, 10:23 AM
  2. Formula to fill cells based on the date in another cell
    By PowerPlayer23 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2012, 02:26 PM
  3. Replies: 1
    Last Post: 09-07-2011, 05:57 PM
  4. Fill the Cell with Zeros upto a fixed number of characters
    By hsmeet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2008, 10:24 PM
  5. Pick all words upto the first dot.
    By ramsdesk in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-01-2007, 03:52 AM

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