+ Reply to Thread
Results 1 to 9 of 9

Auto Spill Rearranged Data Across Range

Hybrid View

Mgc26133 Auto Spill Rearranged Data... 07-04-2022, 11:28 AM
nick.williams Re: Auto Spill Rearranged... 07-04-2022, 12:04 PM
nick.williams Re: Auto Spill Rearranged... 07-04-2022, 12:05 PM
Bo_Ry Re: Auto Spill Rearranged... 07-04-2022, 12:30 PM
Mgc26133 Re: Auto Spill Rearranged... 07-05-2022, 08:59 AM
nick.williams Re: Auto Spill Rearranged... 07-05-2022, 09:03 AM
Mgc26133 Re: Auto Spill Rearranged... 07-05-2022, 10:48 AM
Bo_Ry Re: Auto Spill Rearranged... 07-05-2022, 12:53 PM
Mgc26133 Re: Auto Spill Rearranged... 07-06-2022, 02:42 AM
  1. #1
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Auto Spill Rearranged Data Across Range

    Hello all

    Every day I am receiving a pdf file, and I'm converting it to Excel. However, long cells in the range split their data in a separate row due to their formatting on the pdf. I'm trying to come up with a spill formula to automatically control the range and fix the data to the way it should be, but I can't get it to spill across the range.

    Attaching the manually done version on a simplified sample. Can you take a look and see if it's doable?

    Regards
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Auto Spill Rearranged Data Across Range

    Try something like this?

    =LET(a,IF($A$2:$A$16="",0,1)+IF($B$2:$B$16="",0,1),b,IF($A$3:$A$17="",0,1)+IF($B$3:$B$17="",0,1),c,CHOOSE({1,2},IF(a=0,"",IF(b=0,$C$2:$C$16&" "&$C$3:$C$17,IF($C$2:$C$16="","",$C$2:$C$16))),IF(a=0,"",IF(b=0,$D$2:$D$16&" "&$D$3:$D$17,IF($D$2:$D$16="","",$D$2:$D$16)))),c)

  3. #3
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Auto Spill Rearranged Data Across Range

    Or maybe this if you want to get rid of the blanks in columns A and B?

    =LET(a,IF($A$2:$A$16="",0,1)+IF($B$2:$B$16="",0,1),b,IF($A$3:$A$17="",0,1)+IF($B$3:$B$17="",0,1),c,CHOOSE({1,2,3,4},$A$2:$A$16,$B$2:$B$16,IF(a=0,"",IF(b=0,$C$2:$C$16&" "&$C$3:$C$17,IF($C$2:$C$16="","",$C$2:$C$16))),IF(a=0,"",IF(b=0,$D$2:$D$16&" "&$D$3:$D$17,IF($D$2:$D$16="","",$D$2:$D$16)))),FILTER(c,a>0))

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Auto Spill Rearranged Data Across Range

    Maybe try

    =FILTER(C2:D16,A2:A16)&FILTER(REPT(C2:D16,A2:A16=0),N(+A1:A15))

    or

    =LET(a,A2:A16,b,A2:B16,z,A1:A15,c,A2:D16,FILTER(c,a)&FILTER(REPT(c,a=0),N(+z)))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Re: Auto Spill Rearranged Data Across Range

    @Nick
    That didn't work, unfortunately. It gave two working results at the top, and spilled #N/A error across the rest of the range.

    @Bo_Ry
    That is amazing! However, is it possible to make it work with full column references, like instead of A2:A16, it would be A:A? The reason is, the main data has varying number of rows, it changes every day. Sometimes it's 362, sometimes 545, sometimes 297, another day 644, etc. So with your formula I would still have to manually change the ranges in the formula each time. So if there could be a formula that works regardless of the data length that would be the best. Preferably the 2nd one because in the end that's the data I'm aiming to get, but I can work with the 1st one also.

  6. #6
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Auto Spill Rearranged Data Across Range

    That's strange, it worked when I tested it, but Bo_Ry's solution looks nicer anyway.

  7. #7
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Re: Auto Spill Rearranged Data Across Range

    Bo_Ry hi.

    So I figured the range problem. I just gave it an astronomical number and that solved it. But now the trouble is, since this file is converted from pdf, it also has the column titles from the top of each page. I didn't realize this would be important so I didn't include it to the sample, and that's my bad, I apologize for that.

    I tried to fix it as much as I can using SUBSTITUTE and IFERROR, but I've hit a dead end.

    I reattached the file, can you take a look? This time it's near identical to the main data, I promise so if we figure this one out that would solve this thread.
    Attached Files Attached Files

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Auto Spill Rearranged Data Across Range

    Please try

    =LET(a,A2:A999,b,A2:B999,z,A1:A998,c,A2:J999,x,FILTER(c,N(+a))&FILTER(REPT(" "&c,a=0),N(+z)),IFERROR(--x,x))
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Re: Auto Spill Rearranged Data Across Range

    Works like a charm Many thanks!

+ 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. [SOLVED] Filter to match up range and spill data in range
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-06-2022, 11:08 PM
  2. [SOLVED] Spill Range Across Rows and Columns
    By dluhut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2021, 09:20 AM
  3. Auto insert row on spill error
    By Lazarus Rises in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-30-2021, 09:04 PM
  4. [SOLVED] Removing #spill! and then #N/A from the range
    By homa5424 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-01-2021, 07:01 AM
  5. Replies: 5
    Last Post: 01-27-2021, 12:07 PM
  6. Create table with rearranged data
    By vikramjangra in forum Excel General
    Replies: 2
    Last Post: 06-27-2019, 12:39 AM
  7. Copying data from a row with many columns and pasting with column rearranged
    By ivector in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-03-2014, 07:20 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