Fill Data Series between multiple points, differing steps and gaps

gda_scooby

New Member
Joined
Mar 4, 2019
Messages
1
Afternoon, long time lurker, first time poster (Excel 2016 /Win 10 user)

I have successfully dabbled with various macros and tips from here, but I am now struggling with a seemingly simple task, but I'm not sure what to even search against.

I have a column of negative values, with 'gaps' between values.

The gaps are at different step values between cells, and the number of cells (ie the 'distance') between each value can differ (so can be 2 rows apart or up to 1000 rows apart)

Now I can manually select the range between the two cells and use HOME, FILL, SERIES - and it will automatically work out my step value (linear, columns) and fill that series successfully.

However I have a data set with approximately 12000 rows, and 100+ values to fill between.

How can I automate this?

trigger flagraw valuedesired result
a-29-29
-30
-31
a-32-32
-31.8
-31.6
-31.4
-31.2
a-31-31

<tbody>
</tbody>


The cells in my column between values appear blank, but are not strictly blank - they are the result of a =IF command else where, returning a "" value, then copy/pasted as values into the column I want to fill. therefore I cannot use CTRL + Cursor down to jump the gaps. (I presume this is a secondary problem I have caused)

I have multiple spreadsheets to work on, so any time savings would be appreciated

Thanks in advance,

Gareth
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,210
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
How about
Code:
Sub gda_scooby()
   Dim Rng As Range
   With Range("B2", Range("B" & Rows.count).End(xlUp))
      .Value = .Value
      For Each Rng In .SpecialCells(xlBlanks).Areas
         Rng.Offset(-1).Resize(Rng.count + 2).DataSeries xlColumns, xlLinear, xlDay, , , True
      Next Rng
   End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,108,817
Messages
5,525,070
Members
409,617
Latest member
Lenaf

This Week's Hot Topics

Top