KutoolsforOffice — One Suite. Five Tools. Get More Done.

Fill blank cells with linear values in Excel – (4 Efficient Methods)

AuthorKellyLast modified

In everyday use of Excel, we often encounter data columns that contain blank cells. These blanks may represent data that has not yet been entered or repeated values intentionally omitted for a cleaner layout. In certain analysis tasks, filling these blank cells with linear trend values can help present data trends more clearly and prepare the dataset for subsequent charts or calculations. This comprehensive guide will walk you through several optimized methods to accomplish this efficiently.


Fill blank cells with linear values in Excel

Excel offers several ways to fill blank cells with interpolated linear values. You can use the built-in Fill Series feature, Kutools for Excel, formulas, or VBA. The right method depends largely on whether you are filling one small gap or many blank sections, and whether you want to use formulas or code.


Compare methods for filling blank cells with linear values

All four methods can generate linear values between known numbers, but their workflows differ considerably. Fill Series and formulas are useful built-in approaches for individual sections, VBA provides code-based automation, while Kutools for Excel can process the selected range through a dedicated Fill Blank Cells tool without formulas or macros.

MethodMultiple blank sectionsSetupBest for
Fill SeriesRepeat the operation for each blank sectionSelect each block and apply Fill SeriesQuick built-in interpolation for one or a few blank sections
Kutools for ExcelProcesses blank cells throughout the selected range in one operationSelect the range, choose Fill Blank Cells > Linear values, and specify the fill orderQuickly filling multiple blanks or sections without formulas or VBA
FormulaFormula references must be adjusted for each sectionBuild an interpolation formula and fill it through each blank blockFormula-based calculations where you want control over the interpolation logic
VBACan automate multiple blank sections in the selected listInsert and run a VBA macroRepeatable code-based automation for users comfortable with VBA
Recommendation: Use Fill Series when you only have one or a few blank sections and want a built-in Excel solution, or use a formula when you need control over the interpolation calculation. VBA can automate repeated work but requires macro code. For larger ranges or multiple blank sections, Kutools for Excel provides the most convenient workflow: select the range once, choose Linear values, specify the fill order, and fill the blanks without repeatedly selecting each section, adjusting formulas, or writing VBA.

Fill blank cells with linear values by Fill Series feature

Excel’s Fill Series tool is a built-in way to automatically complete sequences, and it's perfect for filling linear values when blanks occur between two known numbers.

  1. Select the range from A2 to A8, and then click "Home" > "Fill" > "Series", see screenshot:
    click Home > Fill > Series
  2. In the "Series" dialog, just click OK—Excel will fill the first block of blank cells with linear values. See screenshot:
    click ok to fill series
  3. To fill additional blocks of blank cells, select the next range (such as A9:A14) and repeat the steps above to apply linear interpolation.
    select next data and apply the fill serries feature                   all blank cells are filled with series
Note: This method can only fill one block of blank cells at a time. If you have multiple blocks to fill, you'll need to repeat the process for each one.

Fill blank cells with linear values by Kutools for Excel

If you need to fill several blank sections or work with larger ranges, Kutools for Excel’s Fill Blank Cells feature provides a more direct solution. Instead of selecting and processing each blank block separately, you can select the target range, choose Linear values, and let Kutools fill the blanks in one operation. The same tool can also fill blanks based on adjacent values or with a fixed value when needed.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Integrated with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, please do with the following steps:

  1. Select the data range that you want to fill linear values. Then, click Kutools > Insert > Fill Blank Cells, see screenshot:
    Fill Blank Cells feature of kutools
  2. In the Fill Blank Cells dialog box, check the Linear values option and choose the fill order—From left to right or From top to bottom—according to the layout of your data. See screenshot:
    specify the options in the dialog box
  3. Click OK. Kutools automatically fills the blank cells in the selected range with linear values between the known data points. See screenshot:
    fill blank cells with linear values by kutools

Fill blank cells with linear values by a formula

For those who prefer formula-based solutions or want more control over their calculations, using formulas is a reliable and dynamic method.

Suppose your data is in column A (A2:A8), and you want to fill blanks based on a linear interpolation.

1. Enter or copy the following formula in cell A3, (In the above formula, A2 is the start cell, and A8 is the next data cell.) see screenshot:

=A2+($A$8-$A$2)/(ROW($A$8)-ROW($A$2))

enter a formula

2. Drag the fill handle down from A3 to the row just above the next known value (in this example, A7). Once filled, you'll see the blank cells are now populated with interpolated values that follow a straight-line trend between the two known data points.

fill blank cells with linear values by a formula

Notes:
  • This method only works between two known values. If your column contains multiple blocks of blank cells, you’ll need to repeat this process for each block, adjusting the references in the formula accordingly.
  • Make sure your data is numeric, as this method is intended for numerical linear interpolation.

Fill blank cells with linear values by VBA code

If you frequently need to fill blank cells with linear values, a VBA macro can save time by automating the task.

  1. Select the data list you want to fill blank cells with linear values.
  2. Click Alt + F11 to open the Microsoft Visual Basic for Applications window.
  3. Click Insert > Module, and paste the following VBA code into the Module window.
    Sub LinearFillBlanks()
    'Updateby Extendoffice
        Dim rng As Range
        Dim cell As Range
        Dim startCell As Range
        Dim endCell As Range
        Dim i As Long, countBlank As Long
        Dim startVal As Double, endVal As Double, stepVal As Double
        Set rng = Selection
        For i = 1 To rng.Rows.Count
            If Not IsEmpty(rng.Cells(i, 1).Value) Then
                Set startCell = rng.Cells(i, 1)
                startVal = startCell.Value
                countBlank = 0
                Do While i + countBlank + 1 <= rng.Rows.Count And IsEmpty(rng.Cells(i + countBlank + 1, 1))
                    countBlank = countBlank + 1
                Loop
                If i + countBlank + 1 <= rng.Rows.Count Then
                    Set endCell = rng.Cells(i + countBlank + 1, 1)
                    endVal = endCell.Value
                    stepVal = (endVal - startVal) / (countBlank + 1)
                    For j = 1 To countBlank
                        rng.Cells(i + j, 1).Value = startVal + stepVal * j
                    Next j
                End If
            End If
        Next i
    End Sub
    
  4. Then, press the F5 key to run this code. All blank cells in the selected list are filled with linear values. See screenshot:
    fill blank cells with linear values by vba code

Conclusion

Filling blank cells with linear values in Excel can greatly enhance the accuracy and readability of your data, especially when dealing with trends or numerical patterns. The best method depends mainly on how many blank sections you need to process and whether you prefer built-in tools, formulas, or automation.

  • Use Fill Series for a quick built-in solution when you only need to interpolate one or a few sections.
  • Use Kutools for Excel when you want to process a larger selected range or multiple blank sections quickly without formulas or VBA.
  • Use formulas when you want direct control over the interpolation calculation and do not mind adjusting references for different sections.
  • Use VBA when you need a reusable code-based solution and are comfortable working with macros.

For routine work involving multiple blank areas, Kutools for Excel can significantly shorten the process by handling the selected range through one Fill Blank Cells dialog instead of repeating Fill Series operations or rebuilding formulas for each section. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials to help you master Excel.


Related articles:

Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in