How to fill up gaps in excel

0

My data in excel has for example the following data in columns A and B:

A   B

1   4
2   6
5   88
9   67
12  45

and so on.

I would like to transform it as following:

A   B

1   4
2   6
3   0
4   0
5   88
6   0
7   0
8   0
9   67
10  0
11  0
12  45

and so on.

What I want is to insert missing consecutive values on column A values with corresponding column B values as zeros in data.

user1659936

Posted 2015-09-16T15:02:59.997

Reputation: 103

1This can be done with vba – Dave – 2015-09-16T15:25:31.257

Answers

3

I think the easiest way to do this with formulas is with a helper column and vlookup.

Say in column D you print your complete list 1 through 12. Then in column E, you can use -

=IFERROR(VLOOKUP(D1,$A$1:$B$5,2,FALSE),0)

And drag it down.

enter image description here

Raystafarian

Posted 2015-09-16T15:02:59.997

Reputation: 20 384