+ Reply to Thread
Results 1 to 2 of 2

Increment Cell Address every other Column (Currently skips)

  1. #1
    Registered User
    Join Date
    07-03-2017
    Location
    California
    MS-Off Ver
    2010
    Posts
    1

    Increment Cell Address every other Column (Currently skips)

    I want to have columns that give the average and standard deviation for cell parameters, using input from another sheet.

    The input sheet (Sheet1) looks like:

    Item # Location 1 Location 2 Location 3
    1 # # #
    1 # # #
    1 # # #
    2 # # #
    2 # # #
    2 # # #
    2 # # #
    2 # # #
    2 # # #

    And I want the output (Sheet2) to be

    Item # Loc1 Avg Loc1 StD Loc2 Avg Loc2 StD Loc3 Avg Loc3 StD
    1 # # # # # #
    2 # # # # # #


    I have a problem when I try to autofill. For average and StDev, I'm using the following formulas:

    =AVERAGE(IF(Sheet1!$A$2:A$1000$=$A2, Sheet1!B$2:B$1000))
    =STDDEV.S(IF(Sheet1!$A$2:A$1000$=$A2, Sheet1!B$2:B$1000))

    (This next part is abbreviated for readability - D2:D1000 means the formula in that cell reads =AVERAGE(IF(Sheet1!$A$2:A$1000$=$A2, Sheet1!D$2:D$1000)) )

    The autofill works vertically, but when I try to autofill horizontally, it increments the input address by 2 instead of by 1, so instead of getting a B B C C D D... pattern:

    Item # Loc1 Avg Loc1 StD Loc2 Avg Loc2 StD Loc3 Avg Loc3 StD
    1 B2:B1000 B2:B1000 C2:C1000 C2:C1000 D2:D1000 D2:D1000
    2 B2:B1000 B2:B1000 C2:C1000 C2:C1000 D2:D1000 D2:D1000
    n


    I get a B B D D F F ... pattern:

    Item # Loc1 Avg Loc1 StD Loc2 Avg Loc2 StD Loc3 Avg Loc3 StD
    1 B2:B1000 B2:B1000 D2:D1000 D2:D1000 F2:F1000 F2:F1000
    2 B2:B1000 B2:B1000 D2:D1000 D2:D1000 F2:F1000 F2:F1000


    It always skips a column when I autofill. I can't get it to just increment 1 input column every 2 output columns, no matter how many I input manually to establish the pattern. Is there a way I can get excel to stop skipping input columns (Just do A A B B C C etc)?
    Last edited by jtnb; 07-03-2017 at 03:11 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,144

    Re: Increment Cell Address every other Column (Currently skips)

    Try

    in B2

    =AVERAGE(IF(Sheet1!$A$2:$A$1000=$A2,INDEX(Sheet1!$B$2:$Z$1000,,INT((COLUMNS($A:A)-1)/2+1))))

    in c2

    =STDEV.S(IF(Sheet1!$A$2:$A$1000=$A2,INDEX(Sheet1!$B$2:$Z$1000,,INT((COLUMNS($A:A)-1)/2+1))))



    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Select B2 and C2 and drag across and down

+ 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. Increment column address while copying formula down
    By needhelp93 in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 05-05-2014, 03:12 PM
  2. Increment Cell and address formula
    By matrix_xrs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-14-2013, 02:53 PM
  3. Increment count skips, when copying forumla
    By shinbet in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2010, 11:06 PM
  4. how to make cell address reference increment?
    By jacko in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] how to make cell address reference increment?
    By jacko in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 12:05 AM
  6. [SOLVED] how to make cell address reference increment?
    By jacko in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-05-2005, 11:05 PM
  7. how to make cell address reference increment?
    By jacko in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-01-2005, 01:05 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