+ Reply to Thread
Results 1 to 28 of 28

Cell reference columns-rows?

  1. #1
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Cell reference columns-rows?

    Hi,

    I have two sheets, sheet1 are tables with names and values, on sheet2 i need cell reference formula to copy down and across to save me some time. Space between sheet1's tables are always one(1) column.

    =INDIRECT("Sheet1!$B$"+3.......
    Any help would be greatly appreciated!
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Cell reference columns-rows?

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. 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 shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,854

    Re: Cell reference columns-rows?

    For something like this, I tend to prefer the INDEX() function over the INDIRECT() function. I also tend to prefer to include a helper row and column for this.

    INDEX() function help file: https://support.office.com/en-us/art...2-b56b061328bd
    1) I would insert a row at the top of sheet2 and a column at the left of sheet 2.
    2) Recognizing that the "Jack"s values are always in row 1, Mate's values are always in row 3, and Kate's values are always in row 6, I would put these row numbers in that top row in sheet2. These will go into the row_number argument of the INDEX() function.
    3) The first record in sheet2 comes from column B (column 2), and each successive record is 3 columns across from the previous (unless your picture is not representative of the entire data set). In the helper column I inserted in step 1, I would put 2 in A2, the put =A2+3 into A3 and copy that formula down as far as needed.
    4) Then the table fills in just fine with a simple INDEX() function =INDEX(sheet1!$A$1:$AA$6,B$1,$A2) copied down and across. Note the mix of relative and absolute references to make copying simple.

    That's how I'd do it. Others would use the ROW()/ROWS() and/or COLUMN()/COLUMNS() and/or other lookup/counting functions to come up with the row and column numbers. You can explore those options if you like.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Here we go
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    i like OFFSET.

    In shhet 2, a2, coped across and down:

    =OFFSET(INDEX(Sheet1!$A$1:$A$20,MATCH(A$1,Sheet1!$A$1:$A$20,0)),,1+3*(ROWS($1:1)-1),,)

    see sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Great job, mr.Glenn! As always!
    Now, what about MrShorty post#3 solution, actually, i could add top row and first column with numbers for rows/columns count. I already have TODAY() inside workbook, so is it volatile or not isn't realy important.


    Ps. Great problem, i again &again&again forgetting to specify what i actually need My sheet1 tables will be "dynamic". Macro will insert first 3 columns and copy to a1b1 NEW table, so the whole tables will move to right. So your formula probably will not work
    Last edited by B.W.B.; 09-09-2017 at 02:46 AM.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    Run it in your real sheet. I think mine will work. You might need to adjust the ranges of the INDEX-MATCH. But since I'm using I-M to locate the first "Jack", I'm reasonably confident that it'll be OK.

  8. #8
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    It's moving to the right, it's not picking up first 3 columns

    Please Login or Register  to view this content.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    It might not make any difference, but the formula should be anchored on the columns too:

    =OFFSET(INDEX(Sheet1!$A$1:$A$20,MATCH(A$1,Sheet1!$A$1:$A$20,0)),,1+3*(ROWS($1:1)-1),,)

  10. #10
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Good morning! No, it's not working, it's impossible, there always will be three new ABC columns, .... maybe, a Macro to write again new formula in Sheet2 A2:C2 and copy down?

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    One last shot:

    =OFFSET(INDEX(INDIRECT("Sheet1!A1:A20"),MATCH(B1,INDIRECT("Sheet1!A1:A20"),0)),,1+3*(ROWS($1:1)-1),,)

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Cell reference columns-rows?

    @B.W.B.

    Not an anwer to your question, but

    You add the data to a new sheet.

    The columns are related to dates?

    If so that information is not important, since you did not pull that information over?

    The reason I ask you that is since you have VBA in your file, you maybe could use VBA to re-arange the data.

    After that a pivot table could analyse the date.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  13. #13
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Quote Originally Posted by Glenn Kennedy View Post
    One last shot:

    =OFFSET(INDEX(INDIRECT("Sheet1!A1:A20"),MATCH(B1,INDIRECT("Sheet1!A1:A20"),0)),,1+3*(ROWS($1:1)-1),,)
    Yes, big THANK YOU Glenn! Indirect helps to always stay at A1:A20 no mater of column insertion. SOLVED!

    One last tiny bit question, is it possible non-volatile function, use of aggregate or index or....

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    I'm on the move for most of the day. I'll take a look later on.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    OK. Back again. I couldn't get anything to work.

    Option 1. Change your macro to add columns on to the RIGHT of previous data.

    Option 2. Learn to love volatile functions.

  16. #16
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Me again, still not getting this OFFSET(INDIRECT thing.
    New question. Sheet1 data, desired result in sheet2.
    Attached Images Attached Images
    Attached Files Attached Files

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    I don;t immediately see the pattern here. Is this still subject to the "add 3 columns at the left" thing??

    if not, see sheet.

    If yes: your life (and mine!!) would be simpler if the new data were always added left to right
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Yeah, it's pattern , now 3 rows below or 2 or 1.

    I have large data, so having big formula in Sheet2 with 1000 rows will slow my pentium3825U

  19. #19
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    I really cannot get this to work
    Attached Images Attached Images

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    A non-editable picture is useless. I can't really see what's going on.

  21. #21
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    Solved, but, now how to pick up two cells and then jump three rows then again pick up two cells and again...?
    Attached Images Attached Images

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    I will not work with a non-editable picture. Post a sheet.

  23. #23
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    It took me a while preparing the worksheet, I'm trying to macro paste report from Sheet1(List1) to sheet "SPEC_pričuva"(SPEC_backup), it is pasting all from Shhet1, all except formatting, i managed to paste 243 reports, beyond that it's too much, file getting beyond 3MB, so on slower computers will get too much time to load. Sheets2&3(List2&3) are sheets with cell referencing. To reduce size a time for calculation I could copy-paste only values for last 233 reports, and 10 reports left untouched, for users, to be able to correct if something is wrong with report.
    Thank you for your time, God Bless!
    Attached Files Attached Files

  24. #24
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    in List2, A2, copied down:

    =OFFSET(SPEC_pričuva!I$4,52*INT((ROWS($1:1)-1)/3),,,)

    In List 2, B2, copied down:
    =OFFSET(SPEC_pričuva!A$26,MOD(ROWS($1:1)-1,3)+52*INT((ROWS($1:1)-1)/3),,,)

    In List 2, C2, copied across and down:
    =OFFSET(SPEC_pričuva!C$26,MOD(ROWS($1:1)-1,3)+52*INT((ROWS($1:1)-1)/3),,,)





    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
    Attached Files Attached Files

  25. #25
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    Scrap that. use this instead.

    A2
    =INDEX(SPEC_pričuva!I$4:I$10000,1+52*INT((ROWS($1:1)-1)/3))

    B2
    =INDEX(SPEC_pričuva!A$26:A$10000,1+MOD(ROWS($1:1)-1,3)+52*INT((ROWS($1:1)-1)/3))

    C2, across and down:
    =INDEX(SPEC_pričuva!C$26:C$10000,1+MOD(ROWS($1:1)-1,3)+52*INT((ROWS($1:1)-1)/3))
    Attached Files Attached Files

  26. #26
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    It's HOT, nearly done, but, there will not always be 3 rows(The, Last, Row), In Sheet1(List1) there are 18 rows(blank) or 3 populated for that day and 15 blank. How to amend blank and cell referenced only populated based on A column Kupac(Buyer, customer)?
    Last edited by B.W.B.; 09-12-2017 at 09:48 AM.

  27. #27
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: Cell reference columns-rows?

    =INDIRECT("Sheet1!A"&QUOTIENT((ROW()-26),18)*26+MOD((ROW()-26),18)+26)

    Solved by Special-K99
    https://www.mrexcel.com/forum/excel-...ip-3-rows.html

    Thank you all!

  28. #28
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Cell reference columns-rows?

    Glad you got sorted.... but. Please read rule 8:

    8. Don't cross-post without a link. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post. Expect cross-posts without a link to be closed.

+ 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. Reference all rows in vba Columns ()
    By AstToTheRegionalMGR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2015, 01:51 PM
  2. Replies: 7
    Last Post: 08-05-2014, 05:34 AM
  3. [SOLVED] Always reference cell C2, regardless of adding or removing rows/columns
    By gray-ish in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-13-2012, 04:21 PM
  4. Replies: 2
    Last Post: 05-22-2012, 08:50 PM
  5. Replies: 2
    Last Post: 01-01-2012, 05:54 AM
  6. Replies: 3
    Last Post: 04-11-2007, 04:03 AM
  7. [SOLVED] Rows to Columns on reference
    By excelmad in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2006, 01:35 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