How to autofill a column with multiple values

%3CLINGO-SUB%20id%3D%22lingo-sub-1863406%22%20slang%3D%22en-US%22%3EHow%20to%20autofill%20a%20column%20with%20multiple%20values%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1863406%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20a%20spreadsheet%20with%205000%20rows.%20Each%20group%20with%20a%20value%20and%20I%20need%20to%20fill%20down%20each%20cell%20with%20the%20name%20of%20the%20same%20family%20group.%20How%20can%20I%20do%20that%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gty1992_1-1604713745391.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232116i36DB93868F988ED2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22gty1992_1-1604713745391.png%22%20alt%3D%22gty1992_1-1604713745391.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1863406%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1863547%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20autofill%20a%20column%20with%20multiple%20values%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1863547%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F802423%22%20target%3D%22_blank%22%3E%40gty1992%3C%2FA%3E%26nbsp%3BThis%20could%20be%20done%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20Select%20the%20range%20B2%3AB5000%20(or%20whatever%20your%20exact%20range%20may%20be)%3C%2FP%3E%3CP%3E2)%20Press%20F5%20(Go%20to%2C%20Special%2C%20Blanks)%3C%2FP%3E%3CP%3E3)%20This%20should%20select%20all%20blank%20cells%20in%20the%20range%20with%20the%20active%20cell%20in%20B3%3C%2FP%3E%3CP%3E4)%20Now%2C%20in%20%3DB2%20and%20press%20Ctrl-Enter%3C%2FP%3E%3CP%3E5)%20All%20blank%20cells%20will%20now%20contain%20a%20formula%20pointing%20to%20the%20cell%20directly%20above%20it.%3C%2FP%3E%3CP%3E6)%20Copy%20column%20B%20and%20paste%20as%20values%20on%20top%20of%20itself%20if%20you%20don't%20want%20to%20keep%20the%20formulae.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlternatively%2C%20use%20%22Get%20%26amp%3B%20Transform%20Data%22%20(a.k.a.%20Power%20Query%20%22PQ%22)%20if%20this%20is%20recurring%20process%20on%20a%20data%20set%20that%20might%20be%20a%20bit%20more%20complex%20than%20what%20you%20described%20above.%20PQ%20has%20a%20standard%20function%20for%20%22Fill%20Down%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1863847%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20autofill%20a%20column%20with%20multiple%20values%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1863847%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F802423%22%20target%3D%22_blank%22%3E%40gty1992%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20suggest%20two%20possible%20methods%2C%20one%20is%20using%20Helper%20Data%20%26amp%3B%20Formula%20and%20second%20is%26nbsp%3B%3CSPAN%3EVBA%3C%2FSPAN%3E%26nbsp%3BMacro.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EMethod%201%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ESituation%20NAME%20column%20is%26nbsp%3Bblank.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rajesh-S_0-1604743596291.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232139i72344BFB983F95AE%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Rajesh-S_0-1604743596291.png%22%20alt%3D%22Rajesh-S_0-1604743596291.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHow%20it%20works%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3ECreate%20Helper%20data%20as%20shown%20in%20AF2%3AAG5.%3C%2FLI%3E%3CLI%3EFormula%20in%20cell%20AC2%3A%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIFERROR(VLOOKUP(AB2%2C%24AF%242%3A%24AG%245%2C2%2CFALSE)%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rajesh-S_1-1604743792409.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232140iE221014E423F956F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Rajesh-S_1-1604743792409.png%22%20alt%3D%22Rajesh-S_1-1604743792409.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EMethod%202%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rajesh-S_0-1604744530418.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232141iD22E041AF35C7599%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Rajesh-S_0-1604744530418.png%22%20alt%3D%22Rajesh-S_0-1604744530418.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EHit%20Developer%20%3CFONT%20size%3D%223%22%3ETA%3CSPAN%3EB%2C%20find%20and%20click%20DESIGN%2C%20left%20to%20it%20is%20INSERT.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%20color%3D%22%235f6368%22%3E%3CSPAN%3EFrom%20INSERT%2C%20ActiveX%20control%20section%20select%20%26amp%3B%20Draw%20COMMAND%20button.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CFONT%20color%3D%22%235f6368%22%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%3E%3CSPAN%3ESelect%20the%20COMMAND%20%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%3Ebutton%3C%2FSPAN%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%3E%3CSPAN%3E%2C%20Right%20click%20%26amp%3B%20from%20the%20Menu%20hit%20Property%2C%20find%20CAPTION%20and%20change%20it%20to%26nbsp%3B%20Fill%20Value%20(%20%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%3ERemember%3C%2FSPAN%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%3E%3CSPAN%3E%26nbsp%3Bit's%20an%20optional).%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CFONT%20color%3D%22%235f6368%22%3E%3CSPAN%3EDouble%3C%2FSPAN%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%3E%3CSPAN%3E%26nbsp%3Bclick%20the%20COMMAND%20%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%3Ebutton%3C%2FSPAN%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%3E%3CSPAN%3E%26nbsp%3Bto%20open%20VBA%26nbsp%3Beditor.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CFONT%20color%3D%22%235f6368%22%3E%3CFONT%20face%3D%22arial%2C%20sans-serif%22%3E%3CSPAN%3ECopy%20%26amp%3B%20Paste%20this%20code.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-visual%22%3E%3CCODE%3EPrivate%20Sub%20CommandButton1_Click()%0A%0A%20%20%20For%20Each%20cell%20In%20Selection%0A%20%20%20%20If%20cell.Value%20%3D%20%22%22%20Then%0A%20%20%20%20%20%20%20%20cell.Value%20%3D%20cell.Offset(-1%2C%200).Value%0A%20%20%20%20End%20If%0ANext%20cell%0A%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EPress%20ALT%2BQ%20to%20return%20to%20Sheet.%3C%2FLI%3E%3CLI%3ESAVE%20the%20Workbook%20as%20Macro%20Enabled%20(%20*.xlsm%20).%3C%2FLI%3E%3CLI%3ESelect%20AD2%3AAD17%20(%20you%20need%20to%20select%20as%20needed%20).%3C%2FLI%3E%3CLI%3ENow%20hit%20the%20COMMAND%20button.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rajesh-S_1-1604744667751.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232142i795981D170128E4D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Rajesh-S_1-1604744667751.png%22%20alt%3D%22Rajesh-S_1-1604744667751.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EMacro%20will%20fill%20the%20blank%20cells%20as%20shown%20in%20Screen%20Shot%20above.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Visitor

Hi,

I have a spreadsheet with 5000 rows. Each group with a value and I need to fill down each cell with the name of the same family group. How can I do that?

gty1992_1-1604713745391.png

 

Thanks

5 Replies

@gty1992 This could be done as follows:

 

1) Select the range B2:B5000 (or whatever your exact range may be)

2) Press F5 (Go to, Special, Blanks)

3) This should select all blank cells in the range with the active cell in B3

4) Now, in =B2 and press Ctrl-Enter

Edit: 4) Now, enter =B2 and press Ctrl-Enter

5) All blank cells will now contain a formula pointing to the cell directly above it.

6) Copy column B and paste as values on top of itself if you don't want to keep the formulae.

 

Alternatively, use "Get & Transform Data" (a.k.a. Power Query "PQ") if this is recurring process on a data set that might be a bit more complex than what you described above. PQ has a standard function for "Fill Down"

@gty1992 

 

I would like to suggest two possible methods, one is using Helper Data & Formula and second is VBA Macro.

 

Method 1:

 

Situation NAME column is blank.

Rajesh-S_0-1604743596291.png

 

How it works:

  • Create Helper data as shown in AF2:AG5.
  • Formula in cell AC2:

 

=IFERROR(VLOOKUP(AB2,$AF$2:$AG$5,2,FALSE),"")

 

Rajesh-S_1-1604743792409.png

 

Method 2:

 

Rajesh-S_0-1604744530418.png

 

  • Hit Developer TAB, find and click DESIGN, left to it is INSERT.
  • From INSERT, ActiveX control section select & Draw COMMAND button.
  • Select the COMMAND button, Right click & from the Menu hit Property, find CAPTION and change it to  Fill Value ( Remember it's an optional).
  • Double click the COMMAND button to open VBA editor.
  • Copy & Paste this code.

 

Private Sub CommandButton1_Click()

   For Each cell In Selection
    If cell.Value = "" Then
        cell.Value = cell.Offset(-1, 0).Value
    End If
Next cell

End Sub

 

  • Press ALT+Q to return to Sheet.
  • SAVE the Workbook as Macro Enabled ( *.xlsm ).
  • Select AD2:AD17 ( you need to select as needed ).
  • Now hit the COMMAND button.

Rajesh-S_1-1604744667751.png

 

Macro will fill the blank cells as shown in Screen Shot above.

 

@Riny_van_Eekelen Can you please clarify step 4?

"4) Now, in =B2 and press Ctrl-Enter"

My B2 is highlighted, but when I press Ctrl with the Enter, nothing happens?

 

Help! 

@Marra93 I think it contains a typo. It should have read:

 

"4) Now, enter =B2 and press Ctrl-Enter"

 

What I meant to write is that when you have selected all the blank cells (step 3) and the active cell is B3, enter the formula =B2 and then Ctrl-Enter.

 

Sorry about that. 

 

 

@Riny_van_Eekelen You wonderful man...I could just kiss you right now! XOXOXO