+ Reply to Thread
Results 1 to 21 of 21

Needing to copy data without blanks

  1. #1
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Needing to copy data without blanks

    I have a worksheet that has 1900 lines some with data and some without. I want to copy the date from column d and the total from column R over to columns U and T. I am then hoping to filter with out the blanks and copy to another workbook. Colum R is a summation of columns k thru Q. I've tried linking and if statements but I can't get anything to work just right. Column d has dates and those are giving me fits as well with the 1900 date and i custom formatted to get them to 0, but still shows when I filter.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Welcome to the forum.

    As advised in the yellow banner at the top of this page, providing a sample workbook is a good idea.

    HOW TO ATTACH YOUR SAMPLE WORKBOOK: Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,972

    Re: Needing to copy data without blanks

    Maybe this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If not, post a sample workbook.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Needing to copy data without blanks

    I have a spreadsheet in which I that data in columns A,B,C and I need to copy that info without the blanks. I tried the following formula, but keep getting the same line over and over

    =IFERROR(INDEX(A:A,SMALL(IF(A:A<>"",ROW(A:A)),ROW(2:2))),"")

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,972

    Re: Need to copy rows of data without blanks

    With 365, you can use FILTER. Maybe this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    The Let(hs,stack worked great. I need to make it stop at a certain row like row 8 thru 1357. When I do that I ger #N/A. Is that not possible

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Did you copy the formula correctly? If you did, it should limit the range automatically (because it is set to trim the ranges).

  8. #8
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    Original formula before I limited it to stop at a certain cell =LET(hs,HSTACK(B8.:.B10000,R8.:.R10000),FILTER(hs,INDEX(hs,,1)<""))

    Here is the formular after I limited it to stop at a certain line and I get #N/A =LET(hs,HSTACK(B8.:.B1357,R8.:.R1357),FILTER(hs,INDEX(hs,,1)<""))

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Without a workbook to see what's going on, it's nigh on impossible to diagnose. Please provide a sample workbook (desensitised).

  10. #10
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    So here is a snip. I want the dates form column b and amounts from column r over to the right in T and U without any blanks. I need to separate the direct deposit from the scanned so I was thinking of doing scanned in w and x also without the blanks.
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    For direct deposits:

    =LET(hs,TAKE(HSTACK(B8.:.B8140,R8.:.R8140),MATCH("Scanned Deposits",A8.:.A8140,0)),FILTER(hs,INDEX(hs,,2)<>0))

    For scanned deposits:

    =LET(hs,DROP(HSTACK(B8.:.B8140,R8.:.R8140),MATCH("Scanned Deposits",A8.:.A8140,0)),FILTER(hs,INDEX(IFNA(hs,0),,1)<>0))
    Last edited by AliGW; 04-21-2025 at 01:19 PM. Reason: Second formula amended.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    The first formula could be this instead:

    =LET(hs,TAKE(HSTACK(B8.:.B8140,R8.:.R8140),MATCH("Scanned Deposits",A8.:.A8140,0)),FILTER(hs,INDEX(IFNA(hs,0),,1)<>0))

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Oh, I see you've gone. Did it work for you? Some feedback would be nice.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  14. #14
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    Is there a way for it to not grab the subtotals? there is no date in that column so I was hoping it would skip them.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Did you see the second formula?

    This:

    =LET(hs,TAKE(HSTACK(B8.:.B8140,R8.:.R8140),MATCH("Scanned Deposits",A8.:.A8140,0)),FILTER(hs,INDEX(IFNA(hs,0),,1)<>0))

    and this:

    =LET(hs,DROP(HSTACK(B8.:.B8140,R8.:.R8140),MATCH("Scanned Deposits",A8.:.A8140,0)),FILTER(hs,INDEX(IFNA(hs,0),,1)<>0))

    A 'thank you' would be nice ...

    See post #13 which tells you how to sign off this thread.

  16. #16
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    Sorry, I'm still working thru this. I am trying to put the info into my actual spreadhseet to see if it works since its 3,000 lines long. I will let you know for sure if I got it all the way. I do appreciate the help!

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Let me know either way and please sign off the thread.

    It doesn't take much effort to say 'thanks'. It's the only 'payment' we get for our efforts and you're getting it all for free - please don't forget this.

  18. #18
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    I have it figured out why it wasn't working. Someone has rows that are hidden for other types of deposits that I don't see or need the information on. That's why I'm having trouble. Should I just shorten my array?

  19. #19
    Registered User
    Join Date
    04-18-2025
    Location
    Marietta, Ohio
    MS-Off Ver
    365
    Posts
    10

    Re: Needing to copy data without blanks

    Thanks to everyone for their input!

  20. #20
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,972

    Re: Needing to copy data without blanks

    You're welcome. Thanks for the rep.

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,828

    Re: Needing to copy data without blanks

    Lucky you! No rep for me.

+ 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. copy 4 rows of data with blanks to 1 row
    By kenyon76 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2019, 10:41 AM
  2. Copy data from one sheet to another and ignore blanks
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2019, 11:37 AM
  3. [SOLVED] VBA Macros to Look for blanks cells and copy data
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2013, 02:26 AM
  4. [SOLVED] Copy data from one sheet to another while skipping blanks and certain rows
    By gawk1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2013, 07:34 AM
  5. [SOLVED] Copy data from one sheet to another while skipping blanks and certain rows
    By gawk1980 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2013, 01:21 PM
  6. Skip blanks and copy data from other worksheets
    By legendkiller420 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2010, 12:53 PM
  7. Copy/Paste data without blanks
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-24-2009, 10:58 AM

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