Autofilling cells with a formula so only some values are a sequence?

Let’s say that I have a date in one cell. I select that cell, and drag the handle down. This causes all the cells underneath it to have a nice sequence of dates starting from the initial date that was typed. Now, keeping this technique in mind…

The problem:

I have the following formula:

=IFERROR(VLOOKUP(A2;N2:S366;2);“0”)

It checks the date in cell A2, compares it to a date it finds from the zone N2:S266, then displays the value it finds from the cell it finds right next to the cell where the matching date was found. If there is no value, it will display 0.

I would like to spread this same formula to all the cells downwards of the cell in question, but when I drag the handle, three of the values in that formula become an increasing sequence like this:

=IFERROR(VLOOKUP(A2;N2:S366;2);“0”)
=IFERROR(VLOOKUP(A3;N3:S367;2);“0”)
=IFERROR(VLOOKUP(A4;N4:S368;2);“0”)
=IFERROR(VLOOKUP(A5;N5:S369;2);“0”)

The question:
How could I copy this formula so that only the first value (A2-A3-A4-A5 etc) runs as a sequence, and the other numbers stay as they are?

Thanks in advance!

You probably shouild study [Tutorial] Absolute, relative and mixed references (View topic) • Apache OpenOffice Community Forum.

The case

=IFERROR(VLOOKUP(A2;N$2:S$366;2);“0”)

(Yoiur “values” actually are parts of cell- or range-addresses.)

Thank you so much, this solved my issue and now I was able to finish the project!

I’m usually a very experienced and independent googler, but this is one of those rare cases where it’s hard to find an answer because in order to search for information, you first need to have the vocabulary and know what the things you’re dealing with are called. What I was working on here was the v2.0 of the first functional spreadsheet that I’ve ever made, so the vocabulary isn’t quite there yet.

Thanks for the link, I’ll bookmark it for future reference!

“Googling” isn’t the only way of learning. :wink:
The pre-google generations can testify. (I’m 77 and studied “programming” for a very short time in 1964/1965. No google, no web, only one computer (do-it-yourself device by Technische Hochschule München) available for me a few minutes every second week.
But there were books.

1 Like