+ Reply to Thread
Results 1 to 9 of 9

Autofill along a row, taking values from every second column

  1. #1
    Registered User
    Join Date
    11-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    4

    Autofill along a row, taking values from every second column

    Dear forum members,

    I have a problem which i can't solve on my own. Probably there are some answers for this already but I don't even know the appropriate keywords to search for a solution.

    I want to use autofill along a row to do some basic calculations, like adding two values together. The problem is though, that I have to take values from every second column in my source sheet, like this: =C2+E2+F2+H2

    how can i write this in a way so that excel does this, starting with a specified cell?

    The result of the autofill should have no empty cells.


    Thank you all very much!
    Last edited by QuantumDude; 11-11-2013 at 08:21 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Autofill along a row, taking values from every second column

    =C2+E2+F2+H2 is not every other cell
    =C2+E2+g2+i2 is every other cell

    =SUMPRODUCT(--(MOD(COLUMN(C2:T2),2)=1),C2:T2) would sum every other column
    but im not sure what you mean fill across
    do you mean say column 1 = sum(c2) column 2 = sum(c2,e2),colum 3 =sum(c2,e2,g2) col 4 = sum(c2,e2,g2,i2) and so on?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Autofill along a row, taking values from every second column

    May be something like this?

    =SUMPRODUCT(1*ISODD(COLUMN(C2:H2)),C2:H2)


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Autofill along a row, taking values from every second column

    Hi and welcome to the forum!

    Can you clarify precisely which formulas you are attempting to copy, and what you would expect the results to be?

    For example, do you have the formula:

    =C2

    in a cell and, when copied to the right, you wish it to produce, successively:

    =C2+E2
    =C2+E2+F2
    =C2+E2+F2+H2

    etc.?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    11-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Autofill along a row, taking values from every second column

    well, my case is that i have a source sheet with data like this:

    <month> |##blank##| <month>
    <value1a> | <value2> | <value1b> | <value2>

    and on another sheet i have to use only <value1> in a calculation where i go through each month

    <month> | <month> | <month> |.....
    <val1a+x> |<val1b+x> | <val1c+x> |.....

    it would be really tedious to specify the cells "by hand" every time, given that they are already in a certain regular order in the source. i just couldn't find a way to tell excel in which order they are

    P.S.: the sum was just an example. The best thing would be if I would understand in general, how to tell excel to use the value from every second column in a formula that is then used to autofill a range of cells in a row
    Last edited by QuantumDude; 11-11-2013 at 07:34 AM.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Autofill along a row, taking values from every second column

    It will be very helpful if you attach a sample workbook to understand your data structure



    Please attach a sample workbook with enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Note: Please don't attach documents containing confidential data like (address, telephone, ID#s, etc.).

  7. #7
    Registered User
    Join Date
    11-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Autofill along a row, taking values from every second column

    sample.xlsx

    here's a simple sample. already a way to do this would help me a lot!

    at the top is the data structure as in my source. I need a formula that selects cells as in the table below.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Autofill along a row, taking values from every second column

    ok so you need in b13
    =INDEX($B4:$BE4,COLUMNS($B$1:B1)*2-1) fil across and down to row 14

  9. #9
    Registered User
    Join Date
    11-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Autofill along a row, taking values from every second column

    perfect!!!! thank you so much. Now I just have to figure out how this formula works so I can apply it elsewhere :D

+ 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] AutoFill the first emty column based on the values of the last filled column
    By runneer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2013, 01:04 PM
  2. [SOLVED] Autofill different values in one column with dynamic rows
    By JerBear in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-07-2013, 03:45 PM
  3. Taking values from another sheet...
    By angjeleski in forum Excel General
    Replies: 4
    Last Post: 08-16-2008, 01:04 AM
  4. autofill column with values from an access db query?
    By bardschant in forum Excel General
    Replies: 1
    Last Post: 01-23-2008, 07:21 PM
  5. taking out lowest 2 values
    By georgette in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-09-2006, 11:13 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