+ Reply to Thread
Results 1 to 8 of 8

Fill formula in column with data taken from diff columns

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    Ukraine
    MS-Off Ver
    2013
    Posts
    25

    Fill formula in column with data taken from diff columns

    Hello.

    Probably a bit confusing title...

    I have a file with 3 sheets: Sheet 1, Sheet 2, Sheet3
    In Sheet 1 I have a formula in D3 cell:
    Please Login or Register  to view this content.
    In D4 cell I want H:H to be changed to I:I, in D5 to J:J, etc.
    So that in D4 I want to have:
    Please Login or Register  to view this content.
    If I drag formula down it will copy H:H to D4, D5, etc.
    How do I make it increase letter?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Fill formula in column with data taken from diff columns

    Duplicate thread

    http://www.excelforum.com/excel-form...-criteria.html
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Fill formula in column with data taken from diff columns

    Try this

    =SUMIFS(INDIRECT("Sheet 2!"&CHAR(70+ROW())&":"&CHAR(70+ROW())),Sheet 2!$A:$A,$I$1,Sheet 2!$E:$E,Sheet3!$I$4)

    You didnt say you wanted this bit changed
    ...'Sheet 2'!$A:$A,$I$1...

    so I've left it the same

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Fill formula in column with data taken from diff columns

    Try this formula in D3 copied down

    =SUMIFS(INDEX('Sheet 2'!H:IV,0,ROWS(D$3:D3)),'Sheet 2'!$A:$A,$I$1,'Sheet 2'!$E:$E,Sheet3!$I$4)
    Audere est facere

  5. #5
    Registered User
    Join Date
    08-31-2012
    Location
    Ukraine
    MS-Off Ver
    2013
    Posts
    25

    Re: Fill formula in column with data taken from diff columns

    Thanks for helping.
    This is a bit hard for me to understand what it does. Actually I guess that it takes character N70 which is probably the letter I want, and then it will increase it's value. Not sure if it will work for AA, AB...

    I did a workaround
    On a separate sheet I entered desired formula, filled it to the right, so it changed letters as I want, and in the table that this formula was originally I used: {=TRANSPOSE(Sheet3!O2:AR2)}


    UPD:

    Quote Originally Posted by daddylonglegs View Post
    Try this formula in D3 copied down

    =SUMIFS(INDEX('Sheet 2'!H:IV,0,ROWS(D$3:D3)),'Sheet 2'!$A:$A,$I$1,'Sheet 2'!$E:$E,Sheet3!$I$4)
    Well, this one works. Now I have to figure out how...
    H:IV - Why IV?
    Last edited by SergSlim; 08-31-2012 at 09:37 AM.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Fill formula in column with data taken from diff columns

    Quote Originally Posted by SergSlim View Post
    Why IV?
    Just habit.....

    Excel 2003 and earlier versions have 256 columns so the last column is IV. It only really needs to go up to the last column you might need for your requirements, the equivalent of IV in Excel 2010 is XFD

  7. #7
    Registered User
    Join Date
    08-31-2012
    Location
    Ukraine
    MS-Off Ver
    2013
    Posts
    25

    Re: Fill formula in column with data taken from diff columns

    After reading help for the past half an hour or more, I guess it works this way (correct me if I'm wrong):
    ROWS(D$3:D3) - results in number 1. ROWS(D$3:D4) will result in number 2, etc. This way we define which column from H:IV range to pick. 1 will pick H, 2 will pick I, etc.
    0 in Index defines that we take an array of all rows in picked column.

    Sumifs will sum all rows from taken column, if conditions are met.

    Thanks a lot for this solution. It's exactly what I was looking for.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Fill formula in column with data taken from diff columns

    Yes that's right, ROWS(D$3:D3) increments by 1 as you drag down (and unlike some other methods it won't give you incorrect results if you add or delete a row at the top of your worksheet, for instance).

+ 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