AutoFill Cell Based on Another Cell in Excel (5 Easy Methods)

Method 1 – Autofill to End-of-Data

We have a set of names in the Name column. We need to assign an ID serially.

Steps:

  • Select cell C5.
  • Write down the first ID in that cell. We wrote 1.

Write down the first employee id manually to autofill the cell based on another cell

  • Click on the Auto Fill Options icon on the bottom-right and choose the Fill Series option.

Use Auto Fill Options to autofill cell

  • Excel will autofill the cell automatically.

Autofill Cell Based on Another Cell up to End-of-Data

Read More: How to Apply AutoFill Shortcut in Excel


Method 2 – Using the CONCATENATE Function

We have an employee name dataset in separate columns, and we are going to fill the cell of column D.

Steps:

  • Select cell D5.
  • Use the following formula in the cell.

=CONCATENATE(B5,C5)

  • Press Enter.

Using CONCATENATE function

Using Fill Handle tool to copy formula

  • The formula will autofill the cells of column D.

Using CONCATENATE function to autofill cell based on another cell


Method 3 – AutoFill Blank Cells Based on Another Cell

We have the “Name” and “Subject” information of some students. Most of them are from the “Science Faculty” (indicated by “YES”). Those who are not from the “Science Faculty” are given blank cells. We are going to auto-fill those cells.

Steps:

  • Select the range of cells B5:D19.
  • In the Home tab, click on Find & Select and choose the Go To Special option from the Editing group.

Lunching GoTo Special dialog box to autofill cell

  • A small dialog box called Go To Special will appear.
  • Select the Blanks option and click OK.

Choosing suitable option to autofill cell based on another cell

  • All the blank cells will be selected.
  • Write down your text. We put Not Applicable.

  • Press Ctrl + Enter.
  • All the blank cells will fill with the desired text.

AutoFill the Blank Cells Based on Another Cell

Read More: Fix: Excel Autofill Not Working


Method 4 – Utilizing the IF function

We have a dataset with the Names of some students, their “Subject”, “Faculty”, and “Availability” of these subjects. We’ll check if the Faculty is Science and apply text in the Availability column.

Steps:

  • Select cell E5.
  • Use the following formula in the cell.

=IF(D5="Science","YES","N/A")

  • Press Enter.

Utilizing IF function

  • Double-click on the Fill Handle icon to copy the formula up to cell D19.

Application of Fill Handle tool to copy formula to autofill cell

  • The formula will autofill the Availability column with results.

Utilizing IF function to autofill cell based on another cell


Method 5 – Applying the VLOOKUP function

We have a dataset with a scattered format. We are going to sort this and fill the cells of column F based on column E.

Steps:

  • Select cell F5.
  • Use the following formula in the cell:

=VLOOKUP(E5,$B$5:$C$19,2,FALSE)

  • Press Enter.

Applying VLOOKUP function

  • Double-click on the Fill Handle icon to copy the formula up to cell F19.

Use of the Fill Handle tool to copy the formula up to last cell

  • You will get your desired result.

Applying VLOOKUP function to autofill cell based on another cell


Download the Practice Workbook


Further Readings


<< Go Back to Excel Autofill | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Asikul Himel
Asikul Himel

Asikul Islam Himel, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology, has contributed over two years to the ExcelDemy project. Starting as an Excel & VBA Content Developer, now he manages projects at You Have Got This Math Project. He wrote 60+ articles for ExcelDemy, reviewed 500+, and focused on quality maintenance. Currently, his responsibilities include project management and team leadership. Himel's interests encompass data analysis, leadership, WordPress applications, and... Read Full Bio

2 Comments
  1. Thanks for the info- very helpful!! I also need assistance with: transfering gender and language from one column to another in the same row, but am have trouble finding the formula to do this. Any assistance available for that?

  2. Hi HAZEL,
    I am assuming that you want to transfer Gender and Language from one column to another without changing the row position.
    In that case, you can insert a new column to the left of the Gender and Language column.
    To do so,
    ● Select the Gender column.

    avbb

    ● Then, right-click your mouse to bring the context menu.
    ● After that, select Insert.

    b

    ● Excel will add a new column and transfer the Gender and Language column.\

    c

    There is another solution to this problem. You can use the OFFSET function. The advantage of this function is that you can transfer any portion of the columns to anywhere in the Excel sheet.

    Suppose, I want to transfer B8:C10 to E8:F10. To do so,
    ● Go to E8 and write down the following formula
    =OFFSET(B4,4,0,3,2)

    d
    ● Then, press ENTER. Excel will move the cells.

    e
    ● If you use earlier versions of Excel, you have to select E8:F10, then write down the formula and finally press CTRL+SHIFT+ENTER, since the OFFSET function is an array function.

    And lastly, you can copy the cells and paste them to transfer columns.
    I hope it helps. If it does not satisfy you, please let us know.
    Thank you. Have a great day.

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo