+ Reply to Thread
Results 1 to 21 of 21

Drag formula, but in a pattern that skips rows.

  1. #1
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Drag formula, but in a pattern that skips rows.

    Hi all,

    Hoping someone can help.
    I've got a worksheet that has data laid out something like this:
    A1: words
    A2: words
    A3: words
    A4: words
    A5: words
    A6: 1
    A7: 2
    A8: 3
    and then it repeats the sequence above, starting again with "words".

    What I'm trying to do is write a formula I can drag down on Sheet2 that will copy ONLY cells A6:A8 and then A14:A16 and so on, but with no gaps between. So, something like this.

    A1: =Sheet1!A6
    A2: =Sheet1!A7
    A3: =Sheet1!A8
    A4: =Sheet1!A14
    A5: =Sheet1!A15
    A6: =Sheet1!A16
    etc...

    Does that make sense? Hopefully someone can help. thanks so much!!

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

    Re: Drag formula, but in a pattern that skips rows.

    I assume that by "words, you do not literally mean the 5 letters in words? I assume that A6-8, A14-16 contain numbers? Correct? If not pease post a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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

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

    Re: Drag formula, but in a pattern that skips rows.

    Try this array formula in C1, copied down:

    =IFERROR(INDEX(A:A,SMALL(IF(ISNUMBER($A$1:$A$22),ROW($A$1:$A$22)),ROWS(C$1:C1))),"")



    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Drag formula, but in a pattern that skips rows.

    I know a macro that can do this, not sure of a formula

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Thank you for your reply!!
    You are correct, not literally 5 letter words. And no, the cells I put #'s in are not actually numbers but words as well. I've attached a sample workbook that is representative of my project.
    Please let me know if it is not clear.
    Attached Files Attached Files

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

    Re: Drag formula, but in a pattern that skips rows.

    What is to be copied from where, to where?????

    No. see it now.

    So. Is the number of unwanted rows between the wanted rows REALLY variable? It was 9 rows beofre the first block and 10 rows before the second.
    Do the KIAs always begin with the word "subject".

    PLEASE use representative data. Otherwise we may waste a lot of time working on patterns that don't exist.
    Last edited by Glenn Kennedy; 08-24-2017 at 01:10 PM.

  7. #7
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    I put an example on Sheet2 of my uploaded document. Sorry, I should have mentioned that.

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

    Re: Drag formula, but in a pattern that skips rows.

    Non Array formula, should be faster. Paste in A1 and fill down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by mehmetcik; 08-24-2017 at 01:14 PM.
    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.

  9. #9
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Quote Originally Posted by Glenn Kennedy View Post
    So. Is the number of unwanted rows between the wanted rows REALLY variable? It was 9 rows beofre the first block and 10 rows before the second.
    Do the KIAs always begin with the word "subject".

    PLEASE use representative data. Otherwise we may waste a lot of time working on patterns that don't exist.
    Ok, I apologize for the confusion. I have reattached the file and this time it is an exact copy of what I'm working with, just shortened for the purposes of your help. No, unfortunately the KIA's do not always start with the same word. It will be just a random assortment of text in every cell of wanted data.
    Attached Files Attached Files

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

    Re: Drag formula, but in a pattern that skips rows.

    In A2, copied across and down. Much easier now!!

    =OFFSET(Sheet1!B$11,10*INT((ROWS($1:1)-1)/10)+ROWS($1:1),,,)
    Attached Files Attached Files

  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 2406
    Posts
    44,662

    Re: Drag formula, but in a pattern that skips rows.

    Excel is all about patterns. Once you know what the pattern is... the rest falls into place, like falling off a log. Easy(ish)

  12. #12
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Quote Originally Posted by Glenn Kennedy View Post
    In A2, copied across and down. Much easier now!!

    =OFFSET(Sheet1!B$11,10*INT((ROWS($1:1)-1)/10)+ROWS($1:1),,,)
    THAT'S PERFECT! Well I can tell I'm going to enjoy my time on this forum. You were so helpful! Wish I could thank you more. I added reputation.

  13. #13
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Quote Originally Posted by Glenn Kennedy View Post
    Excel is all about patterns. Once you know what the pattern is... the rest falls into place, like falling off a log. Easy(ish)

    Yeah, i really need to polish up on how =OFFSET works. From all my searching, I figured this is what I would need to use; but I can't seem to figure out how it works. I need to find a good beginners guide / tutorial to how offset formulas work...

  14. #14
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Oooo, one thing I forgot that would be super helpful IF it can be added. Is there a way that formula could be modified to skip any blank cells? I completely forgot that there are occasions where 1 or 2 of the KIA's might be blank.

  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 2406
    Posts
    44,662

    Re: Drag formula, but in a pattern that skips rows.

    =OFFSET(Sheet1!B$11,10*INT((ROWS($1:1)-1)/10)+ROWS($1:1),,,)

    red: start with this cell
    Cyan: staring with zero: increment by 1 every 10 rows
    orange: and then multiply that number by 10
    Once you have a toal, move down that number of rows,

    looking at this again, there might just be an error in it. try it on a larger dataset and let me know...
    Green: and then add the row number

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

    Re: Drag formula, but in a pattern that skips rows.

    If EVERYTHING that is to be returned is text, modify as shown:

    =OFFSET(Sheet1!B$11,10*INT((ROWS($1:1)-1)/10)+ROWS($1:1),,,)&""

  17. #17
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    That did work to give me a "blank" cells instead of zeros, so I'm one step closer! However, what I'm really hoping to do is make my list on Sheet2 populate with no blank rows between the data. I don't know if a formula can do that or if I'll need a macro. I would just use a filter on Sheet2 and sort out the blanks, but I need it to auto-update every time more cells are filled in Sheet1.

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

    Re: Drag formula, but in a pattern that skips rows.

    Ha. You smashed the pattern. Of course there are (sometimes) Plans B that can be brought into action. An array formula in sheet2, cell A2, copied across and down:


    =IFERROR(INDEX(Sheet1!B:B,SMALL(IF(ISERROR(MATCH(Sheet1!$B$12:$B$41,Sheet1!$B$2:$B$11,0)),IF(Sheet1!$B$12:$B$41<>"",ROW(Sheet1!$B$12:$C$41))),ROWS($1:1))),"")


    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Quote Originally Posted by Glenn Kennedy View Post
    Ha. You smashed the pattern. Of course there are (sometimes) Plans B that can be brought into action.
    Hahaha, yes I definitely did. I finally got around to putting this into my spreadsheet today and it worked like a champ! Now that there are no gaps I'm able to get my macro that sets calendar reminders in Outlook to run properly. Thank you again! If I run into another snag, I'll leave another reply. I'm trying to have this project wrapped up by end of next week.

  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 2406
    Posts
    44,662

    Re: Drag formula, but in a pattern that skips rows.

    You're welcome.



    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.

  21. #21
    Registered User
    Join Date
    08-24-2017
    Location
    Nashville, TN
    MS-Off Ver
    Office 2007
    Posts
    16

    Re: Drag formula, but in a pattern that skips rows.

    Quote Originally Posted by Glenn Kennedy View Post
    You're welcome.



    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.
    Done and done. Thanks again!!

+ 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. Drag down which skips every 8 rows
    By Applebus in forum Excel General
    Replies: 2
    Last Post: 07-01-2017, 05:51 PM
  2. [SOLVED] drag multiple functions, formula skips cells
    By larsweil in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-23-2017, 11:43 PM
  3. [SOLVED] Drag Formula that Skips 1 Column
    By brendangroff in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-14-2016, 03:01 PM
  4. Replies: 14
    Last Post: 11-26-2015, 09:43 AM
  5. [SOLVED] Drag fill not recognising formula pattern
    By steveneedshelp in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-12-2015, 09:06 AM
  6. copy a formula that skips rows
    By mo2982 in forum Excel General
    Replies: 2
    Last Post: 06-09-2014, 10:41 AM
  7. [SOLVED] Drag Formula that skips every 12 Rows
    By kqball in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-01-2013, 12: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