+ Reply to Thread
Results 1 to 4 of 4

how to assign specific cells to specific values based on an incremental variable

  1. #1
    Registered User
    Join Date
    03-26-2011
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    2

    how to assign specific cells to specific values based on an incremental variable

    I'm working on the attached spreadsheet and trying to figure out how I can perform the following operation:

    I want to assign J2,J3:AH2,AH3 to reflect the values in F4:F9 and G4:G9 according to the variable in D2.

    For example, if the value is D2 is "4", I want the value in F4 reflected in J2:M2. Then, I want the value in F5 reflected in O2:R2, F6 in T2:W2 and so on.
    If the value in D2 is "6", I want the value in F4 in J2:M2, O2, P2 (skipping N2) and the value in F5 in Q2, R2 (skipping S2), T2:W2 etc....

    I don't even know what this would be called and as I said I have almost no experience in excel. Any help will be greatly appreciated.

    Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: how to assign specific cells to specific values based on an incremental variable

    You need F4 to be reflected in J2:M2 either D2 is 4 or 6 then you can give direct cell referance
    ie in cell J2 put =$F$4
    in cell O2 & P2 put =if($D$2=6,$F$4,"")

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: how to assign specific cells to specific values based on an incremental variable

    In J2 put this formula:

    =INDEX($F$4:$F$10,CEILING(COUNTIF($J$1:J$1,"Week*")/$D$2,1))

    drag it over to M2. Now copy those 4 cells and paste in O2 and repeat for T2, Y2, etc.

  4. #4
    Registered User
    Join Date
    03-26-2011
    Location
    Idaho
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: how to assign specific cells to specific values based on an incremental variable

    Cutter, Thank you so much! It works perfectly.

+ 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