fill empty cells

jm saf 166 Reputation points
2021-01-17T12:36:36.213+00:00

Hi!
Starting from table 1, I need some way to get the result that I indicate in table output so that the empty cells are completed in the indicated way.
My real table have +20000 rows so so i really appreciate any help.

start data (table 1)
57218-imagen.png

Result after process
57258-imagen.png

Thanks in advance

Regards

Microsoft 365 and Office Excel For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Lz._ 9,016 Reputation points
    2021-01-17T17:51:35.027+00:00

    Hi @jm saf

    With Get & Transform aka Power Query. With your data in Table1, use the following query code:

    let  
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],  
        #"Changed Type" = Table.TransformColumnTypes(Source,  
            {  
                {"Date", type date}, {"User", type number},  
                {"Pto", type text}, {"Center", type number}  
            }  
        ),  
        #"Grouped Rows" = Table.Group(#"Changed Type", {"User"},  
            {"GRP", each  
                Table.FillDown(  
                    Table.FillUp(_, {"Pto","Center"}),  
                    {"Pto","Center"}  
                ),  
                type table  
            }  
        ),  
        #"Combined Tables" = Table.Combine(#"Grouped Rows"[GRP])  
    in  
        #"Combined Tables"  
    

    Corresponding sample available here:

    • Put your data in the blue table
    • Right-click in the green table > Refresh

4 additional answers

Sort by: Most helpful
  1. HansV 966 Reputation points MVP
    2021-01-17T14:07:20.317+00:00

    Let's say that the table is in columns A to D.
    Select columns C and D.
    Press F5 or Ctrl+G to activate the Go To dialog.
    Click Special...
    Select Blanks, then click OK.
    Look at the name box on the left hand side of the formula bar. You will see the address of the active cell.
    I'll assume that it is C1.
    Enter the following formula and confirm it with Ctrl+Enter:

    =C2


  2. Erin Ding-MSFT 4,476 Reputation points
    2021-01-18T07:55:03.25+00:00

    @jm saf

    I did the test based on the answer of HansV-7609 and reproduced your issue.
    57518-1.png

    If I complete the information like below screenshot, there will be no problem.
    57519-2.png
    57520-3.png
    So please make sure the information of the row that is above the row you start to change is complete before using the method given by HansV-7609.

    Besides, please check if the answer given by Lz-3068 is helpful to you.

    Any updates, please let us know.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. jm saf 166 Reputation points
    2021-01-18T13:55:16.39+00:00

    Hi!

    I don't know if I'm doing something wrong, but i have done the test based on the answer of HansV-7609 in my real data, there are cases in which a user with blank records before the data of another user, puts the data of the next one in the blank records of the previous.

    Lz-3068 seems to be a good solution, but I'm not familiar with power pivot. I would need to see manuals on how it works

    Thanks for your interest.

    0 comments No comments

  4. Lz._ 9,016 Reputation points
    2021-01-19T06:45:55.783+00:00

    Hi jmsaf-4508

    Easiest way to understand/replicate:
    1/ Take Table1 as below where there's only 1 User ID

    58021-demo.png

    2/ Load it table to Power Query
    3/ Select columns [Pto] and [Center]
    4/ Go to the Transform tab
    5/ Fill Up
    6/ Fill Down

    Some Power Query learning resources in this PDF


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.